1 /* PR c/103881 */
2 /* { dg-do compile } */
3 /* { dg-options "-Wconversion" } */
4
5 unsigned char bar (void);
6
7 void
8 foo (void)
9 {
10 unsigned char t = 0;
11 t |= bar ();
12 t |= bar () & bar (); /* { dg-bogus "conversion from 'int' to 'unsigned char' may change value" "" { xfail c++ } } */
13 t &= bar () & bar (); /* { dg-bogus "conversion from 'int' to 'unsigned char' may change value" "" { xfail c++ } } */
14 t = bar () & bar ();
15
16 unsigned char a = bar ();
17 t |= a & a;
18 t |= bar () & a; /* { dg-bogus "conversion from 'int' to 'unsigned char' may change value" "" { xfail c++ } } */
19 t |= a & bar (); /* { dg-bogus "conversion from 'int' to 'unsigned char' may change value" "" { xfail c++ } } */
20 }