summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/test/clang-tidy/cppcoreguidelines-pro-bounds-constant-array-index-c++03.cpp
blob: ad9fcd97daa4fd28b324fb8258697a43529d7ba1 (plain)
1
2
3
4
5
6
7
8
9
10
11
// RUN: clang-tidy %s -checks=-*,cppcoreguidelines-pro-bounds-constant-array-index -- -std=c++03 | count 0

// Note: this test expects no diagnostics, but FileCheck cannot handle that,
// hence the use of | count 0.
template <int index> struct B {
  int get() {
    // The next line used to crash the check (in C++03 mode only).
    return x[index];
  }
  int x[3];
};
OpenPOWER on IntegriCloud