1 /* { dg-options "-fdiagnostics-show-caret" } */
2 
test_nonconst_static_assert(int param)3 void test_nonconst_static_assert (int param)
4 {
5   int local = 0;
6 
7   _Static_assert (param > 0, "message"); /* { dg-error "expression in static assertion is not constant" } */
8 /* { dg-begin-multiline-output "" }
9    _Static_assert (param > 0, "message");
10                    ~~~~~~^~~
11 { dg-end-multiline-output "" } */
12 
13   _Static_assert (param, "message"); /* { dg-error "expression in static assertion is not constant" } */
14 /* { dg-begin-multiline-output "" }
15    _Static_assert (param, "message");
16                    ^~~~~
17 { dg-end-multiline-output "" } */
18 
19   _Static_assert (local, "message"); /* { dg-error "expression in static assertion is not constant" } */
20 /* { dg-begin-multiline-output "" }
21    _Static_assert (local, "message");
22                    ^~~~~
23 { dg-end-multiline-output "" } */
24 }
25