PR lto/84212 - -Wno-* does not disable warnings from -flto link stage
[official-gcc.git] / gcc / testsuite / g++.dg / warn / pr28943.C
blob046312c0e4b21c8215b8cc901b54fe1381be4451
1 // PR c++/28943 void and non-void in conditional expression
2 // { dg-do compile }
3 // { dg-options "" }
5 void debug (const char * string)
7   return;
10 int f()
12   ( true == false ? 0 : debug ("Some string")); // { dg-error "third operand .* type 'void'.* second operand is neither a throw-expression nor of type 'void'" }
13   ( true == false ? debug ("Some string") : 0 ); // { dg-error "second operand .* type 'void'.* third operand is neither a throw-expression nor of type 'void'" }
14   return 0;