This project is mirrored from https://github.com/llvm-doe-org/llvm-project.git. Pull mirroring updated .
  1. 23 Jan, 2022 1 commit
    • Carlos Galvez's avatar
      [clang-tidy] Remove gsl::at suggestion from cppcoreguidelines-pro-bounds-constant-array-index · eb3f20e8
      Carlos Galvez authored
      Currently the fix hint is hardcoded to gsl::at(). This poses
      a problem for people who, for a number of reasons, don't want
      or cannot use the GSL library (introducing a new third-party
      dependency into a project is not a minor task).
      
      In these situations, the fix hint does more harm than good
      as it creates confusion as to what the fix should be. People
      can even misinterpret the fix "gsl::at" as e.g. "std::array::at",
      which can lead to even more trouble (e.g. when having guidelines
      that disallow exceptions).
      
      Furthermore, this is not a requirement from the C++ Core Guidelines.
      simply that array indexing needs to be safe. Each project should
      be able to decide upon a strategy for safe indexing.
      
      The fix-it is kept for people who want to use the GSL library.
      
      Differential Revision: https://reviews.llvm.org/D117857
      eb3f20e8
  2. 11 Oct, 2019 1 commit
    • Dmitri Gribenko's avatar
      [ClangTidy] Separate tests for infrastructure and checkers · 885c5593
      Dmitri Gribenko authored
      Summary:
      This change moves tests for checkers and infrastructure into separate
      directories, making it easier to find infrastructure tests. Tests for
      checkers are already easy to find because they are named after the
      checker. Tests for infrastructure were difficult to find because they
      were outnumbered by tests for checkers. Now they are in a separate
      directory.
      
      Reviewers: jfb, jdoerfert, lebedev.ri
      
      Subscribers: srhines, nemanjai, aheejin, kbarton, christof, mgrang, arphaman, jfb, lebedev.ri, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D68807
      
      llvm-svn: 374540
      885c5593
  3. 19 Jul, 2016 1 commit
    • Matthias Gehre's avatar
      cppcoreguidelines-pro-bounds-constant-array-index: ignore implicit constructor · dd117cf0
      Matthias Gehre authored
      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
      dd117cf0
  4. 13 Dec, 2015 2 commits
  5. 18 Nov, 2015 1 commit
  6. 17 Nov, 2015 1 commit