Go to the documentation of this file.
9 #include "../ClangTidy.h"
10 #include "../ClangTidyModule.h"
11 #include "../ClangTidyModuleRegistry.h"
12 #include "../misc/NonPrivateMemberVariablesInClassesCheck.h"
13 #include "../misc/UnconventionalAssignOperatorCheck.h"
14 #include "../modernize/AvoidCArraysCheck.h"
15 #include "../modernize/UseOverrideCheck.h"
16 #include "../readability/MagicNumbersCheck.h"
42 namespace cppcoreguidelines {
49 "cppcoreguidelines-avoid-c-arrays");
51 "cppcoreguidelines-avoid-goto");
53 "cppcoreguidelines-avoid-magic-numbers");
55 "cppcoreguidelines-avoid-non-const-global-variables");
57 "cppcoreguidelines-explicit-virtual-functions");
59 "cppcoreguidelines-init-variables");
61 "cppcoreguidelines-interfaces-global-init");
63 "cppcoreguidelines-macro-usage");
65 "cppcoreguidelines-narrowing-conversions");
68 "cppcoreguidelines-non-private-member-variables-in-classes");
70 "cppcoreguidelines-owning-memory");
72 "cppcoreguidelines-prefer-member-initializer");
74 "cppcoreguidelines-pro-bounds-array-to-pointer-decay");
76 "cppcoreguidelines-pro-bounds-constant-array-index");
78 "cppcoreguidelines-pro-bounds-pointer-arithmetic");
80 "cppcoreguidelines-pro-type-const-cast");
82 "cppcoreguidelines-pro-type-cstyle-cast");
84 "cppcoreguidelines-pro-type-member-init");
86 "cppcoreguidelines-pro-type-reinterpret-cast");
88 "cppcoreguidelines-pro-type-static-cast-downcast");
90 "cppcoreguidelines-pro-type-union-access");
92 "cppcoreguidelines-pro-type-vararg");
94 "cppcoreguidelines-special-member-functions");
97 "cppcoreguidelines-c-copy-assignment-signature");
99 "cppcoreguidelines-virtual-class-destructor");
106 Opts[
"cppcoreguidelines-non-private-member-variables-in-classes."
107 "IgnoreClassesWithAllMemberVariablesBeingPublic"] =
"true";
114 static ClangTidyModuleRegistry::Add<CppCoreGuidelinesModule>
115 X(
"cppcoreguidelines-module",
"Adds checks for the C++ Core Guidelines.");
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override
Implement this function in order to register all CheckFactories belonging to this module.
llvm::StringMap< ClangTidyValue > OptionMap
Checks for classes where some, but not all, of the special member functions are defined.
Flags possible initialization order issues of static variables.
Checks for usages of static_cast, where a base class is downcasted to a derived class.
This checker is concerned with C-style memory management and suggest modern alternatives to it.
A module containing checks of the C++ Core Guidelines.
The usage of goto for control flow is error prone and should be replaced with looping constructs.
static ClangTidyModuleRegistry::Add< CppCoreGuidelinesModule > X("cppcoreguidelines-module", "Adds checks for the C++ Core Guidelines.")
This checker finds classes that not only contain the data (non-static member variables),...
OptionMap CheckOptions
Key-value mapping used to store check-specific options.
ClangTidyOptions getModuleOptions() override
Gets default options for checks defined in this module.
Contains options for clang-tidy.
Finds declarations of assignment operators with the wrong return and/or argument types and definition...
A collection of ClangTidyCheckFactory instances.
Finds base classes whose destructor is neither public and virtual nor protected and non-virtual.
Flags all occurrences of reinterpret_cast.
Finds member initializations in the constructor body which can be placed into the initialization list...
Checks for narrowing conversions, e.g: int i = 0; i += 0.1;.
Implements C++ Core Guidelines Type.6.
This check flags all array to pointer decays.
Find macro usage that is considered problematic because better language constructs exist for the task...
volatile int CppCoreGuidelinesModuleAnchorSource
Find uninitialized local variables.
Use C++11's override and remove virtual where applicable.
Flags slicing (incomplete copying of an object's state) of member variables or vtable.
Detects magic numbers, integer and floating point literals embedded in code.
Non-const global variables hide dependencies and make the dependencies subject to unpredictable chang...
This check flags all access to members of unions.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
This check flags all calls to c-style variadic functions and all use of va_arg.
Flags all kinds of pointer arithmetic that have result of pointer type, i.e.
This check flags all use of C-style casts that perform a static_cast downcast, const_cast,...
This checks that all array subscriptions on static arrays and std::arrays have a constant index and a...
This check flags all instances of const_cast.
A clang-tidy module groups a number of ClangTidyChecks and gives them a prefixed name.
Checks for common use cases for gsl::owner and enforces the unique owner nature of it whenever possib...
void registerCheck(llvm::StringRef CheckName)
Registers the CheckType with the name Name.
Find C-style array types and recommend to use std::array<> / std::vector<>.