Official docs:
Checks for usages of identifiers reserved for use by the
implementation. The C and C++ standards both reserve the following
names for such use: identifiers that begin with an underscore followed
by an uppercase letter; identifiers in the global namespace that begin
with an underscore.
Official docs:
Checks for usages of identifiers reserved for use by the
implementation. The C and C++ standards both reserve the following
names for such use: identifiers that begin with an underscore followed
by an uppercase letter; identifiers in the global namespace that begin
with an underscore.
Official docs:
Finds calls to new with missing exception handler for std::bad_alloc.
Calls to new may throw exceptions of type std::bad_alloc that should
be handled. Alternatively, the nonthrowing form of new can be used.
The check verifies that the exception is handled in the function that
calls new. If a nonthrowing version is used or the exception is
allowed to propagate out of the function no warning is generated. The
exception handler is checked if it catches a std::bad_alloc or
std::exception exception type, or all exceptions (catch-all). The
check assumes that any user-defined operator new is either noexcept or
may throw an exception of type std::bad_alloc (or one derived from
it). Other exception class types are not taken into account.
Official docs:
Finds cnd_wait, cnd_timedwait, wait, wait_for, or wait_until function
calls when the function is not invoked from a loop that checks whether
a condition predicate holds or the function has a condition parameter.
Official docs:
Finds pointers with the noescape attribute that are captured by an
asynchronously-executed block. The block arguments in dispatch_async()
and dispatch_after() are guaranteed to escape, so it is an error if a
pointer with the noescape attribute is captured by one of these
blocks.
Official docs:
This check will warn when there is a cast of a calculation result to a
bigger type. If the intention of the cast is to avoid loss of
precision then the cast is misplaced, and there can be loss of
precision. Otherwise the cast is ineffective.
Official docs:
The check looks for perfect forwarding constructors that can hide copy
or move constructors. If a non const lvalue reference is passed to the
constructor, the forwarding reference parameter will be a better match
than the const reference parameter of the copy constructor, so the
perfect forwarding constructor will be called, which can be confusing.
Official docs:
Finds instances of static variables that are dynamically initialized in
header files. This can pose problems in certain multithreaded contexts.
Official docs:
Adds pointer qualifications to auto-typed variables that are deduced to
pointers. This makes it obvious if a auto typed variable is a pointer.
This check will transform auto to auto * when the type is deduced to be
a pointer.
Official docs:
Replaces assert() with static_assert() if the condition is evaluable
at compile time. The condition of static_assert() is evaluated at
compile time which is safer and more efficient.
Official docs:
Finds assert() with side effect. The condition of assert() is
evaluated only in debug builds so a condition with side effect can
cause different behavior in debug / release builds.
Official docs:
This check replaces the uses of the deprecated class std::auto_ptr by
std::unique_ptr (introduced in C++11). The transfer of ownership, done
by the copy-constructor and the assignment operator, is changed to
match std::unique_ptr usage by using explicit calls to std::move().
Official docs:
The check diagnoses any static_assert declaration with an empty string
literal and provides a fix-it to replace the declaration with a
single-argument static_assert declaration.
Official docs:
Correct indentation helps to understand code. Mismatch of the
syntactical structure and the indentation of the code may hide serious
problems.