blob: bb3f53bcf7ba1955b24f4afc3b869b51adb3f034 [file] [log] [blame]
/* PR c/103881 */
/* { dg-do compile } */
/* { dg-options "-Wconversion" } */
unsigned char bar (void);
void
foo (void)
{
unsigned char t = 0;
t |= bar ();
t |= bar () & bar (); /* { dg-bogus "conversion from 'int' to 'unsigned char' may change value" "" { xfail c++ } } */
t &= bar () & bar (); /* { dg-bogus "conversion from 'int' to 'unsigned char' may change value" "" { xfail c++ } } */
t = bar () & bar ();
unsigned char a = bar ();
t |= a & a;
t |= bar () & a; /* { dg-bogus "conversion from 'int' to 'unsigned char' may change value" "" { xfail c++ } } */
t |= a & bar (); /* { dg-bogus "conversion from 'int' to 'unsigned char' may change value" "" { xfail c++ } } */
}