Go to file
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
clang Add support of the latest Ubuntu (Yakkety Yak - 16.10) 2016-07-19 14:00:57 +00:00
clang-tools-extra cppcoreguidelines-pro-bounds-constant-array-index: ignore implicit constructor 2016-07-19 17:02:54 +00:00
compiler-rt fix compiler warnings [NFC] 2016-07-19 15:30:22 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc R600: Use new barrier intrinsic 2016-07-18 18:42:17 +00:00
libcxx Bump version # to 4.0.0 2016-07-18 20:27:19 +00:00
libcxxabi Fix arc config to use https 2016-07-18 02:05:52 +00:00
libunwind [PATCH] [libunwind][ehabi] Use early returns where possible. 2016-07-08 12:13:31 +00:00
lld Fix build with gcc 6. 2016-07-19 12:33:46 +00:00
lldb Typo corrections identified by codespell 2016-07-19 15:28:02 +00:00
llgo Upgrade all the .arcconfigs to https. 2016-07-14 13:15:37 +00:00
llvm [X86][AVX] Fixed typo in test names 2016-07-19 16:52:05 +00:00
openmp http://reviews.llvm.org/D22134: Implementation of OpenMP 4.5 nonmonotonic schedule modifier 2016-07-11 10:44:57 +00:00
parallel-libs Set up arcconfig for parallel-libs project 2016-07-18 17:26:26 +00:00
polly GPGPU: Bail out of scops with hoisted invariant loads 2016-07-19 15:56:25 +00:00