aboutsummaryrefslogtreecommitdiff
path: root/clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-bugfix.cpp
blob: 25f2c71a316d79b6a29919844ba9ebdc957a21a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// RUN: %check_clang_tidy -expect-clang-tidy-error %s readability-identifier-naming %t

// This used to cause a null pointer dereference.
auto [left] = right;
// CHECK-MESSAGES: :[[@LINE-1]]:15: error: use of undeclared identifier 'right'

namespace crash_on_nonidentifiers {
struct Foo {
  operator bool();
};
void foo() {
  // Make sure we don't crash on non-identifier names (e.g. conversion
  // operators).
  if (Foo()) {}
}
}