aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaCXX/warn-unsafe-buffer-usage-crashes.c
blob: e02172ac22554253868365e571dcd386d223b794 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// 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}}
  }};
}