Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
Checks: '*,-abseil-*,-altera-*,-android-*,-boost-*,-cert-*,-cppcoreguidelines-*,-darwin-*,-fuchsia-*,-google-*,-hicpp-*,-linuxkernel-*,-llvm-*,-llvmlibc-*,-mpi-*,-objc-*,-openmp-*,-zircon-*,google-explicit-constructor,-readability-braces-around-statements,-readability-magic-numbers,-bugprone-macro-parentheses,-readability-isolate-declaration,-readability-function-size,-modernize-use-trailing-return-type,-readability-implicit-bool-conversion,-readability-uppercase-literal-suffix,-modernize-use-auto,-readability-else-after-return,-modernize-use-default-member-init,-readability-redundant-member-init,-performance-faster-string-find,-modernize-avoid-c-arrays,-modernize-use-equals-default,-readability-container-size-empty,-readability-simplify-boolean-expr,-bugprone-branch-clone,-bugprone-narrowing-conversions,-modernize-raw-string-literal,-readability-convert-member-functions-to-static,-modernize-loop-convert,-readability-const-return-type,-modernize-return-braced-init-list,-performance-inefficient-string-concatenation,-misc-throw-by-value-catch-by-reference,-readability-avoid-const-params-in-decls,-misc-non-private-member-variables-in-classes,-clang-analyzer-*,-bugprone-signed-char-misuse,-misc-no-recursion,-readability-use-anyofallof,-performance-no-automatic-move,-readability-function-cognitive-complexity,-readability-redundant-access-specifiers,-performance-noexcept-move-constructor,-concurrency-mt-unsafe,-bugprone-easily-swappable-parameters,-readability-suspicious-call-argument,-readability-identifier-length,-readability-container-data-pointer,-bugprone-assignment-in-if-condition,-misc-const-correctness,-portability-std-allocator-const,-modernize-deprecated-ios-base-aliases,-bugprone-unchecked-optional-access,-modernize-replace-auto-ptr,-readability-identifier-naming,-portability-simd-intrinsics'
WarningsAsErrors: '*'
HeaderFilterRegex: '(cli|gui|lib|oss-fuzz|test|triage)\/[a-z]+\.h'
CheckOptions:
- key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
value: '1'
1 change: 1 addition & 0 deletions lib/analyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct Analyzer {
template<class T,
REQUIRES("T must be convertible to unsigned int", std::is_convertible<T, unsigned int> ),
REQUIRES("T must not be a bool", !std::is_same<T, bool> )>
// NOLINTNEXTLINE(google-explicit-constructor)
Action(T f) : mFlag(f) // cppcheck-suppress noExplicitConstructor
{}

Expand Down
2 changes: 2 additions & 0 deletions lib/programmemory.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ struct ExprIdToken {

ExprIdToken() = default;
// cppcheck-suppress noExplicitConstructor
// NOLINTNEXTLINE(google-explicit-constructor)
ExprIdToken(const Token* tok) : tok(tok) {}
// TODO: Make this constructor only available from ProgramMemory
// cppcheck-suppress noExplicitConstructor
// NOLINTNEXTLINE(google-explicit-constructor)
ExprIdToken(nonneg int exprid) : exprid(exprid) {}

nonneg int getExpressionId() const;
Expand Down
2 changes: 2 additions & 0 deletions lib/smallvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ struct TaggedAllocator : std::allocator<T>
{
template<class ... Ts>
// cppcheck-suppress noExplicitConstructor
// NOLINTNEXTLINE(google-explicit-constructor)
TaggedAllocator(Ts&&... ts)
: std::allocator<T>(std::forward<Ts>(ts)...)
{}
Expand All @@ -47,6 +48,7 @@ class SmallVector : public std::vector<T, TaggedAllocator<T, N>>
{
public:
template<class ... Ts>
// NOLINTNEXTLINE(google-explicit-constructor)
SmallVector(Ts&&... ts)
: std::vector<T, TaggedAllocator<T, N>>(std::forward<Ts>(ts)...)
{
Expand Down
2 changes: 1 addition & 1 deletion lib/token.h
Original file line number Diff line number Diff line change
Expand Up @@ -1216,7 +1216,7 @@ class CPPCHECKLIB Token {

void removeValues(std::function<bool(const ValueFlow::Value &)> pred) {
if (mImpl->mValues)
mImpl->mValues->remove_if(pred);
mImpl->mValues->remove_if(std::move(pred));
}

nonneg int index() const {
Expand Down
2 changes: 2 additions & 0 deletions lib/valueptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class CPPCHECKLIB ValuePtr {

template<class U>
// cppcheck-suppress noExplicitConstructor
// NOLINTNEXTLINE(google-explicit-constructor)
ValuePtr(const U& value) : mPtr(cloner<U>::apply(&value)), mClone(&cloner<U>::apply)
{}

Expand Down Expand Up @@ -91,6 +92,7 @@ class CPPCHECKLIB ValuePtr {
return *this;
}

// NOLINTNEXTLINE(google-explicit-constructor)
operator bool() const NOEXCEPT {
return !!mPtr;
}
Expand Down
2 changes: 2 additions & 0 deletions test/redirect.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
#include <sstream>
#include <string>

// NOLINTNEXTLINE(readability-redundant-declaration) - TODO: fix this
extern std::ostringstream errout;
// NOLINTNEXTLINE(readability-redundant-declaration) - TODO: fix this
extern std::ostringstream output;
/**
* @brief Utility class for capturing cout and cerr to ostringstream buffers
Expand Down