1 /* { dg-options "-fdiagnostics-show-caret" } */
3 /* Adapted from https://gcc.gnu.org/wiki/ClangDiagnosticsComparison */
10 myvec
[1]/ptr
; /* { dg-error "invalid operands to binary /" } */
12 /* TODO: ideally we'd underline "ptr" as well.
13 { dg-begin-multiline-output "" }
18 { dg-end-multiline-output "" } */
25 extern struct s
some_function (void);
26 extern struct t
some_other_function (void);
30 return (some_function ()
31 + some_other_function ()); /* { dg-error "invalid operands to binary \+" } */
33 /* { dg-begin-multiline-output "" }
34 return (some_function ()
38 + some_other_function ());
39 ^ ~~~~~~~~~~~~~~~~~~~~~~
42 { dg-end-multiline-output "" } */
45 int test_3 (struct s param_s
, struct t param_t
)
47 return param_s
+ param_t
; // { dg-error "invalid operands to binary \+" }
49 /* { dg-begin-multiline-output "" }
50 return param_s + param_t;
52 { dg-end-multiline-output "" } */
53 /* TODO: ideally we'd underline both params here. */
59 extern S
callee_4a (void);
60 extern T
callee_4b (void);
64 return callee_4a () + callee_4b (); /* { dg-error "invalid operands to binary \+" } */
66 /* { dg-begin-multiline-output "" }
67 return callee_4a () + callee_4b ();
68 ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
72 { dg-end-multiline-output "" } */