[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / warn-unsafe-buffer-usage-crashes.c
blobe02172ac22554253868365e571dcd386d223b794
1 // RUN: %clang_cc1 -Wunsafe-buffer-usage -fsafe-buffer-usage-suggestions \
2 // RUN: %s -verify %s
4 void gnu_stmtexpr_crash(void) {
5 struct A {};
6 struct B {
7 struct A a;
8 };
10 struct B b = {{
11 // This is a statement-expression (GNU extension).
12 ({ int x; }) // no-crash // expected-warning{{excess elements in struct initializer}}
13 }};