bolt/deps/llvm-18.1.8/clang-tools-extra/test/clang-tidy/checkers/readability/identifier-naming-bugfix.cpp
2025-02-14 19:21:04 +01:00

16 lines
432 B
C++

// 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()) {}
}
}