[clang-tidy] cppcoreguidelines-interfaces-global-init
Summary: This check flags initializers of globals that access extern objects, and therefore can lead to order-of-initialization problems (this recommandation is part of CPP core guidelines). Note that this only checks half of the guideline for now (it does not enforce using constexpr functions). Reviewers: aaron.ballman, alexfh Subscribers: aaron.ballman, etienneb, Eugene.Zelenko, cfe-commits Patch by Clement Courbet! Differential Revision: http://reviews.llvm.org/D18649 llvm-svn: 265774
This commit is contained in:
@@ -11,6 +11,7 @@
|
||||
#include "../ClangTidyModule.h"
|
||||
#include "../ClangTidyModuleRegistry.h"
|
||||
#include "../misc/AssignOperatorSignatureCheck.h"
|
||||
#include "InterfacesGlobalInitCheck.h"
|
||||
#include "ProBoundsArrayToPointerDecayCheck.h"
|
||||
#include "ProBoundsConstantArrayIndexCheck.h"
|
||||
#include "ProBoundsPointerArithmeticCheck.h"
|
||||
@@ -30,6 +31,8 @@ namespace cppcoreguidelines {
|
||||
class CppCoreGuidelinesModule : public ClangTidyModule {
|
||||
public:
|
||||
void addCheckFactories(ClangTidyCheckFactories &CheckFactories) override {
|
||||
CheckFactories.registerCheck<InterfacesGlobalInitCheck>(
|
||||
"cppcoreguidelines-interfaces-global-init");
|
||||
CheckFactories.registerCheck<ProBoundsArrayToPointerDecayCheck>(
|
||||
"cppcoreguidelines-pro-bounds-array-to-pointer-decay");
|
||||
CheckFactories.registerCheck<ProBoundsConstantArrayIndexCheck>(
|
||||
|
||||
Reference in New Issue
Block a user