clang/test/SemaCXX/warn-unsafe-buffer-usage-crashes.c
raw| 1 | // RUN: %clang_cc1 -Wunsafe-buffer-usage -fsafe-buffer-usage-suggestions \ |
| 2 | // RUN: %s -verify %s |
| 3 | |
| 4 | void gnu_stmtexpr_crash(void) { |
| 5 | struct A {}; |
| 6 | struct B { |
| 7 | struct A a; |
| 8 | }; |
| 9 | |
| 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 | }}; |
| 14 | } |