PR tree-optimization/83369 - Missing diagnostics during inlining
[official-gcc.git] / gcc / testsuite / gcc.dg / c11-static-assert-1.c
blob9209a7a4076dbd5f99b09e1efd928de34fa0bcd5
1 /* Test C11 static assertions. Valid assertions. */
2 /* { dg-do compile } */
3 /* { dg-options "-std=c11 -pedantic-errors" } */
5 _Static_assert (1, "foo");
7 enum e { E0, E1 };
9 _Static_assert (E1, L"bar");
11 _Static_assert (-1, "foo" L"bar");
13 struct s
15 int a;
16 _Static_assert (3, "s");
17 int b;
20 union u
22 int i;
23 _Static_assert ((int)1.0, L"");
26 void
27 f (void)
29 int i;
30 i = 1;
31 _Static_assert (0 + 1, "f");
32 i = 2;
35 void
36 g (void)
38 int i = 0;
39 for (_Static_assert (1, ""); i < 10; i++)