[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / gcc.dg / pr59963-2.c
blobefd86b02170ce56a360f5bcd49d081364a4bbb24
1 /* PR c/59963 */
2 /* { dg-do compile } */
3 /* { dg-options "-Woverflow -Wconversion" } */
5 extern void bar (unsigned char);
6 extern void bar8 (unsigned char, unsigned char, unsigned char, unsigned char,
7 unsigned char, unsigned char, unsigned char, unsigned char);
8 extern void bazu (unsigned int, ...);
9 extern void bazi (char, int);
10 extern int f (short a, short b);
12 int
13 g (void)
15 return f (0xffffffffL, /* { dg-warning "13:-Woverflow" } */
16 0xffffffffL) /* { dg-warning "13:-Woverflow" } */
17 && f (0xffffffffL, /* { dg-warning "16:-Woverflow" } */
18 0xffffffffL); /* { dg-warning "16:-Woverflow" } */
21 void
22 foo (int i)
24 bar (256); /* { dg-warning "8:-Woverflow" } */
25 bar (6.66f); /* { dg-warning "8:conversion" } */
26 bar8 (-1, /* { dg-warning "9:-Wsign-conversion" } */
27 -2, /* { dg-warning "10:-Wsign-conversion" } */
28 -3, /* { dg-warning "11:-Wsign-conversion" } */
29 -4, /* { dg-warning "12:-Wsign-conversion" } */
30 -5, /* { dg-warning "13:-Wsign-conversion" } */
31 -6, /* { dg-warning "14:-Wsign-conversion" } */
32 -7, /* { dg-warning "15:-Wsign-conversion" } */
33 -8); /* { dg-warning "16:-Wsign-conversion" } */
34 bazu (i, i); /* { dg-warning "9:conversion" } */
35 bazi (0x8, 0x80000000); /* { dg-warning "14:-Wsign-conversion" "" { xfail int16 } } */