xref: /llvm-project/clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-bugfix.cpp (revision b36a2e7828befcf948f461b72c78a8d2386db2e7)
1 // RUN: %check_clang_tidy -expect-clang-tidy-error %s readability-identifier-naming %t
2 
3 // This used to cause a null pointer dereference.
4 auto [left] = right;
5 // CHECK-MESSAGES: :[[@LINE-1]]:15: error: use of undeclared identifier 'right'
6 
7 namespace crash_on_nonidentifiers {
8 struct Foo {
9   operator bool();
10 };
foo()11 void foo() {
12   // Make sure we don't crash on non-identifier names (e.g. conversion
13   // operators).
14   if (Foo()) {}
15 }
16 }
17