Debian Codegraph @

gcc/testsuite/c-c++-common/diagnostic-format-json-4.c

raw
1 /* { dg-do compile } */
2 /* { dg-options "-fdiagnostics-format=json -Wmisleading-indentation" } */
3
4 int test (void)
5 {
6 if (1)
7 return 3;
8 return 4;
9 return 5;
10 }
11
12 /* { dg-begin-multiline-output "" }
13 [{"kind": "warning",
14 "message": "this 'if' clause does not guard...",
15 "option": "-Wmisleading-indentation",
16 { dg-end-multiline-output "" } */
17 /* { dg-regexp " \"option_url\": \"https:\[^\n\r\"\]*#index-Wmisleading-indentation\",\n" } */
18 /* { dg-begin-multiline-output "" }
19 "children": [{"kind": "note",
20 "message": "...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'",
21 "locations": [{"caret": {"file":
22 "line": 8,
23 "display-column": 5,
24 "byte-column": 5,
25 "column": 5},
26 "finish": {"file":
27 "line": 8,
28 "display-column": 10,
29 "byte-column": 10,
30 "column": 10}}],
31 "escape-source": false}],
32 "column-origin": 1,
33 "locations": [{"caret": {"file":
34 "line": 6,
35 "display-column": 3,
36 "byte-column": 3,
37 "column": 3},
38 "finish": {"file":
39 "line": 6,
40 "display-column": 4,
41 "byte-column": 4,
42 "column": 4}}],
43 "escape-source": false}]
44 { dg-end-multiline-output "" } */