Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/warn/pr28943.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // PR c++/28943 void and non-void in conditional expression |
2 // { dg-do compile } | |
3 // { dg-options "" } | |
4 | |
5 void debug (const char * string) | |
6 { | |
7 return; | |
8 } | |
9 | |
10 int f() | |
11 { | |
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; | |
15 } |