Go to the documentation of this file.
9 #include "../ClangTidy.h"
10 #include "../ClangTidyModule.h"
11 #include "../ClangTidyModuleRegistry.h"
12 #include "../cppcoreguidelines/NarrowingConversionsCheck.h"
85 "bugprone-argument-comment");
87 "bugprone-assert-side-effect");
89 "bugprone-assignment-in-if-condition");
91 "bugprone-bad-signal-to-kill-thread");
93 "bugprone-bool-pointer-implicit-conversion");
96 "bugprone-copy-constructor-init");
98 "bugprone-dangling-handle");
100 "bugprone-dynamic-static-initializers");
102 "bugprone-easily-swappable-parameters");
104 "bugprone-exception-escape");
107 "bugprone-forward-declaration-namespace");
109 "bugprone-forwarding-reference-overload");
111 "bugprone-implicit-widening-of-multiplication-result");
113 "bugprone-inaccurate-erase");
115 "bugprone-incorrect-roundings");
118 "bugprone-integer-division");
120 "bugprone-lambda-function-name");
122 "bugprone-macro-parentheses");
124 "bugprone-macro-repeated-side-effects");
126 "bugprone-misplaced-operator-in-strlen-in-alloc");
128 "bugprone-misplaced-pointer-arithmetic-in-alloc");
130 "bugprone-misplaced-widening-cast");
132 "bugprone-move-forwarding-reference");
134 "bugprone-multiple-statement-macro");
136 "bugprone-redundant-branch-condition");
138 "bugprone-narrowing-conversions");
141 "bugprone-not-null-terminated-result");
143 "bugprone-parent-virtual-call");
146 "bugprone-reserved-identifier");
148 "bugprone-shared-ptr-array-mismatch");
151 "bugprone-signed-char-misuse");
153 "bugprone-sizeof-container");
155 "bugprone-sizeof-expression");
157 "bugprone-spuriously-wake-up-functions");
159 "bugprone-string-constructor");
161 "bugprone-string-integer-assignment");
163 "bugprone-string-literal-with-embedded-nul");
165 "bugprone-stringview-nullptr");
167 "bugprone-suspicious-enum-usage");
169 "bugprone-suspicious-include");
171 "bugprone-suspicious-memory-comparison");
173 "bugprone-suspicious-memset-usage");
175 "bugprone-suspicious-missing-comma");
177 "bugprone-suspicious-semicolon");
179 "bugprone-suspicious-string-compare");
181 "bugprone-swapped-arguments");
183 "bugprone-terminating-continue");
185 "bugprone-throw-keyword-missing");
187 "bugprone-too-small-loop-variable");
189 "bugprone-unchecked-optional-access");
191 "bugprone-undefined-memory-manipulation");
193 "bugprone-undelegated-constructor");
195 "bugprone-unhandled-self-assignment");
197 "bugprone-unhandled-exception-at-new");
200 "bugprone-unused-return-value");
203 "bugprone-virtual-near-miss");
210 static ClangTidyModuleRegistry::Add<bugprone::BugproneModule>
211 X(
"bugprone-module",
"Adds checks for bugprone code constructs.");
Checker for signal handler functions.
This check gives a warning if a loop variable has a too small type which might not be able to represe...
Block arguments in dispatch_async() and dispatch_after() are guaranteed to escape.
Finds copy constructors where the ctor don't call the copy constructor of the base class.
This check finds string literals which are probably concatenated accidentally.
Finds cases where integer division in a floating point context is likely to cause unintended loss of ...
Finds instances where an integer is assigned to a string.
Finds assert() with side effect.
Checks for repeated argument with side effects in macros.
Find and flag invalid initializer values in folds, e.g.
Checks for inaccurate use of the erase() method.
The check warns if std::move is applied to a forwarding reference (i.e.
Finds potentially incorrect calls to memcmp() based on properties of the arguments.
Finds pthread_kill function calls when thread is terminated by SIGTERM signal.
Find suspicious calls to string compare functions.
Finds calls to 'new' that may throw unhandled exception at allocation failure.
Checks for near miss of virtual methods.
Finds those signed char -> integer conversions which might indicate a programming error.
The checker looks for constructors that can act as copy or move constructors through their forwarding...
Detect when func or FUNCTION is being used from within a lambda.
Finds user-defined copy assignment operators which do not protect the code against self-assignment ei...
A collection of ClangTidyCheckFactory instances.
Checks for conditions based on implicit conversion from a bool pointer to bool.
Finds cnd_wait, cnd_timedwait, wait, wait_for, or wait_until function calls when the function is not ...
Finds function calls where it is possible to cause a not null-terminated result.
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module.
Find suspicious usages of sizeof expression.
Finds cases where 1 is added to the string in the argument to a function in the strlen() family inste...
Find std::shared_ptr<T>(new T[...]), replace it (if applicable) with std::shared_ptr<T[]>(new T[....
Diagnoses instances of an implicit widening of multiplication result.
Finds cases where an integer is added to or subracted from the result of a memory allocation function...
Finds macros that can have unexpected behaviour due to missing parentheses.
Checks for narrowing conversions, e.g: int i = 0; i += 0.1;.
Finds creation of temporary objects in constructors that look like a function call to another constru...
Checks if a 'continue' statement terminates the loop (i.e.
Find usages of sizeof on expressions of STL container types.
Warns when the code is unwrapping a std::optional<T>, absl::optional<T>, or base::Optional<T> object ...
Finds dynamically initialized static variables in header files.
Detect dangling references in value handlers like std::experimental::string_view.
The checker detects various cases when an enum is probably misused (as a bitmask).
Finds memset calls with potential mistakes in their arguments.
Checks for usages of identifiers reserved for use by the implementation.
Finds suspicious string constructor and check their parameters.
The check warns if an object is used after it has been moved, without an intervening reinitialization...
Finds calls to grand..-parent virtual methods instead of parent's.
Detect multiple statement macros that are used in unbraced conditionals.
Checks the usage of patterns known to produce incorrect rounding.
Finds functions which should not throw exceptions: Destructors, move constructors,...
Finds temporaries that look like RAII objects.
Checks if an unused forward declaration is in a wrong namespace.
Detects function calls where the return value is unused.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
This check finds semicolon that modifies the meaning of the program unintendedly.
Finds function definitions where parameters of convertible types follow each other directly,...
Find casts of calculation results to bigger type.
Finds condition variables in nested if statements that were also checked in the outer if statement an...
A check for detecting if/else if/else chains where two or more branches are Type I clones of each oth...
volatile int BugproneModuleAnchorSource
Warns on inclusion of files whose names suggest that they're implementation files,...
Catches assignments within the condition clause of an if statement.
Find suspicious string literals with embedded NUL characters.
Finds potentially swapped arguments by looking at implicit conversions.
static ClangTidyModuleRegistry::Add< altera::AlteraModule > X("altera-module", "Adds Altera FPGA OpenCL lint checks.")
Checks for various ways that the const CharT* constructor of std::basic_string_view can be passed a n...
Emits a warning about temporary objects whose type is (or is derived from) a class that has 'EXCEPTIO...
Finds obvious infinite loops (loops where the condition variable is not changed at all).
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Finds calls of memory manipulation functions memset(), memcpy() and memmove() on not TriviallyCopyabl...
void registerCheck(llvm::StringRef CheckName)
Registers the CheckType with the name Name.