PR tree-optimization/86401
[official-gcc.git] / gcc / testsuite / c-c++-common / missing-close-symbol.c
blobabeb83748c163161d15f8584d174b3dc250a042f
1 /* { dg-options "-fdiagnostics-show-caret" } */
3 /* Verify that the C/C++ frontends show the pertinent opening symbol when
4 a closing symbol is missing. */
6 /* Verify that, when they are on the same line, that the opening symbol is
7 shown as a secondary range within the main diagnostic. */
9 void test_static_assert_same_line (void)
11 _Static_assert(sizeof(int) >= sizeof(char), "msg"; /* { dg-error "expected '\\)' before ';' token" } */
12 /* { dg-begin-multiline-output "" }
13 _Static_assert(sizeof(int) >= sizeof(char), "msg";
14 ~ ^
16 { dg-end-multiline-output "" } */
19 /* Verify that, when they are on different lines, that the opening symbol is
20 shown via a secondary diagnostic. */
22 void test_static_assert_different_line (void)
24 _Static_assert(sizeof(int) >= sizeof(char), /* { dg-message "to match this '\\('" } */
25 "msg"; /* { dg-error "expected '\\)' before ';' token" } */
26 /* { dg-begin-multiline-output "" }
27 "msg";
30 { dg-end-multiline-output "" } */
31 /* { dg-begin-multiline-output "" }
32 _Static_assert(sizeof(int) >= sizeof(char),
34 { dg-end-multiline-output "" } */