aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/parse
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-06-30 22:04:36 +0000
committerJakub Jelinek <jakub@redhat.com>2009-06-30 22:04:36 +0000
commit92ccce85a59bf937fc568ae0a4a04101a30db90c (patch)
tree22d4472aed1465f326e3cc594adf1560e23c69d9 /gcc/testsuite/g++.dg/parse
parent1d9c2314bda6a698fbddc29de58ecc490c1b0846 (diff)
PR c++/40566
* convert.c (convert_to_integer) <case COND_EXPR>: Don't convert to type arguments that have void type. * g++.dg/parse/cond5.C: New test. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@149121 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/parse')
-rw-r--r--gcc/testsuite/g++.dg/parse/cond5.C10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/parse/cond5.C b/gcc/testsuite/g++.dg/parse/cond5.C
new file mode 100644
index 00000000000..7ed9fbe892e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/cond5.C
@@ -0,0 +1,10 @@
+// PR c++/40566
+
+void
+f (int x, int y)
+{
+ int c = x ? 23 : throw "bla";
+ short d = y ? throw "bla" : 23;
+ char e = x ? 23 : throw "bla";
+ long f = x ? 23 : throw "bla";
+}