2 /* { dg-do compile } */
3 /* { dg-options "-Wsign-compare -fdiagnostics-show-caret" } */
6 f0 (int x
, unsigned int y
)
8 return x
? y
: -1; /* { dg-warning "18:operand of \\?: changes signedness from 'int' to 'unsigned int'" } */
9 /* { dg-begin-multiline-output "" }
12 { dg-end-multiline-output "" } */
16 f1 (int xxx
, unsigned int yyy
)
18 return xxx
? yyy
: -1; /* { dg-warning "22:operand of \\?: changes signedness from 'int' to 'unsigned int'" } */
19 /* { dg-begin-multiline-output "" }
20 return xxx ? yyy : -1;
22 { dg-end-multiline-output "" } */
26 f2 (int xxx
, unsigned int yyy
)
28 return xxx
? -1 : yyy
; /* { dg-warning "16:operand of \\?: changes signedness from 'int' to 'unsigned int'" } */
29 /* { dg-begin-multiline-output "" }
30 return xxx ? -1 : yyy;
32 { dg-end-multiline-output "" } */
38 return yyy
?: -1; /* { dg-warning "17:operand of \\?: changes signedness from 'int' to 'unsigned int'" } */
39 /* { dg-begin-multiline-output "" }
42 { dg-end-multiline-output "" } */
46 f4 (int xxx
, unsigned yyy
, short uuu
)
48 return xxx
? yyy
: uuu
; /* { dg-warning "22:operand of \\?: changes signedness from 'short int' to 'unsigned int'" } */
49 /* { dg-begin-multiline-output "" }
50 return xxx ? yyy : uuu;
52 { dg-end-multiline-output "" } */
56 f5 (int xxx
, unsigned yyy
, short uuu
)
58 return xxx
? uuu
: yyy
; /* { dg-warning "16:operand of \\?: changes signedness from 'short int' to 'unsigned int'" } */
59 /* { dg-begin-multiline-output "" }
60 return xxx ? uuu : yyy;
62 { dg-end-multiline-output "" } */
66 f6 (int xxx
, unsigned yyy
, signed char uuu
)
68 return xxx
? yyy
: uuu
; /* { dg-warning "22:operand of \\?: changes signedness from 'signed char' to 'unsigned int'" } */
69 /* { dg-begin-multiline-output "" }
70 return xxx ? yyy : uuu;
72 { dg-end-multiline-output "" } */
76 f7 (int xxx
, unsigned yyy
, signed char uuu
)
78 return xxx
? uuu
: yyy
; /* { dg-warning "16:operand of \\?: changes signedness from 'signed char' to 'unsigned int'" } */
79 /* { dg-begin-multiline-output "" }
80 return xxx ? uuu : yyy;
82 { dg-end-multiline-output "" } */