llvm-project/clang-tools-extra/clang-tidy/cppcoreguidelines
Matthias Gehre dd117cf01d cppcoreguidelines-pro-bounds-constant-array-index: ignore implicit constructor
Summary:
The code

  struct A {
    int x[3];
  };

gets an compiler-generated copy constructor that uses ArraySubscriptExpr (see below).
Previously, the check would generate a warning on that copy constructor.
This commit disables the warning on implicitly generated code.
AST:

  |-CXXConstructorDecl 0x337b3c8 <col:8> col:8 implicit used constexpr A 'void (const struct A &) noexcept' inline
  | |-ParmVarDecl 0x337b510 <col:8> col:8 used 'const struct A &'
  | |-CXXCtorInitializer Field 0x3379238 'x' 'int [3]'
  | | `-ImplicitCastExpr 0x337e158 <col:8> 'int' <LValueToRValue>
  | |   `-ArraySubscriptExpr 0x337e130 <col:8> 'const int' lvalue
  | |     |-ImplicitCastExpr 0x337e118 <col:8> 'const int *' <ArrayToPointerDecay>
  | |     | `-MemberExpr 0x337dfc8 <col:8> 'int const[3]' lvalue .x 0x3379238
  | |     |   `-DeclRefExpr 0x337dfa0 <col:8> 'const struct A' lvalue ParmVar 0x337b510 '' 'const struct A &'
  | |     `-ImplicitCastExpr 0x337e098 <col:8> 'unsigned long' <LValueToRValue>
  | |       `-DeclRefExpr 0x337e070 <col:8> 'unsigned long' lvalue Var 0x337e010 '__i0' 'unsigned long'

Reviewers: alexfh, aaron.ballman

Subscribers: aemerson, nemanjai, cfe-commits

Differential Revision: https://reviews.llvm.org/D22381

llvm-svn: 275993
2016-07-19 17:02:54 +00:00
..
CMakeLists.txt [clang-tidy] cppcoreguidelines-interfaces-global-init 2016-04-08 09:51:06 +00:00
CppCoreGuidelinesTidyModule.cpp [clang-tidy] New: checker misc-unconventional-assign-operator replacing misc-assign-operator-signature 2016-05-04 12:02:22 +00:00
InterfacesGlobalInitCheck.cpp [clang-tidy] cppcoreguidelines-interfaces-global-init 2016-04-08 09:51:06 +00:00
InterfacesGlobalInitCheck.h [clang-tidy] cppcoreguidelines-interfaces-global-init 2016-04-08 09:51:06 +00:00
ProBoundsArrayToPointerDecayCheck.cpp [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProBoundsArrayToPointerDecayCheck.h [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProBoundsConstantArrayIndexCheck.cpp cppcoreguidelines-pro-bounds-constant-array-index: ignore implicit constructor 2016-07-19 17:02:54 +00:00
ProBoundsConstantArrayIndexCheck.h [clang-tidy] Cleanup namespace in utils folder. 2016-05-03 02:54:05 +00:00
ProBoundsPointerArithmeticCheck.cpp [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProBoundsPointerArithmeticCheck.h [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeConstCastCheck.cpp [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeConstCastCheck.h [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeCstyleCastCheck.cpp [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeCstyleCastCheck.h [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeMemberInitCheck.cpp Fixed cppcoreguidelines-pro-type-member-init when checking records with indirect fields 2016-05-10 07:42:19 +00:00
ProTypeMemberInitCheck.h Complete support for C++ Core Guidelines Type.6: Always initialize a member variable. 2016-04-13 11:35:47 +00:00
ProTypeReinterpretCastCheck.cpp [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeReinterpretCastCheck.h [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeStaticCastDowncastCheck.cpp [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeStaticCastDowncastCheck.h [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeUnionAccessCheck.cpp [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeUnionAccessCheck.h [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeVarargCheck.cpp [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00
ProTypeVarargCheck.h [clang-tidy] Cleaning namespaces to be more consistant across checkers. 2016-05-02 18:00:29 +00:00