bolt/deps/llvm-18.1.8/clang/test/SemaCXX/warn-unsafe-buffer-usage-crashes.c

15 lines
362 B
C
Raw Normal View History

2025-02-14 19:21:04 +01:00
// RUN: %clang_cc1 -Wunsafe-buffer-usage -fsafe-buffer-usage-suggestions \
// RUN: %s -verify %s
void gnu_stmtexpr_crash(void) {
struct A {};
struct B {
struct A a;
};
struct B b = {{
// This is a statement-expression (GNU extension).
({ int x; }) // no-crash // expected-warning{{excess elements in struct initializer}}
}};
}