Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / warn / Wconversion-pr91993.C
blob63a8462f9edb45ea8c0977ab66dda1b68d2a6c7f
1 // PR c++/91993
2 // { dg-do compile }
3 // { dg-options "-Wconversion" }
5 typedef unsigned char uc;
7 int
8 foo (const uc &a, const uc &b, const uc &c)
10   return static_cast<uc>(static_cast<uc>(a << 1U) | b) | c;             // { dg-bogus "conversion from 'int' to 'unsigned char' may change value" }
13 int
14 bar (const uc &a, const uc &b, const uc &c, int &d)
16   return static_cast<uc>(static_cast<uc>((d++, a) << 1U) | b) | c;      // { dg-bogus "conversion from 'int' to 'unsigned char' may change value" }