summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/expr
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-03 01:25:13 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2005-11-03 01:25:13 +0000
commite8fe69c33b9164dabea5d77c80c03090a58e8ced (patch)
tree661d0838f488e6d552b82cd1954a06b88e0521ff /gcc/testsuite/g++.dg/expr
parent206dacd9e1f288a7de5949a590c529909b0bcd44 (diff)
downloadgcc-e8fe69c33b9164dabea5d77c80c03090a58e8ced.tar.gz
PR c++/22434
* call.c (build_conditional_expr): Do bad conversions, if there's no other choice. PR c++/22434 * g++.dg/expr/cond8.C: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@106418 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/expr')
-rw-r--r--gcc/testsuite/g++.dg/expr/cond8.C13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/expr/cond8.C b/gcc/testsuite/g++.dg/expr/cond8.C
new file mode 100644
index 00000000000..f05c81a26ce
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/cond8.C
@@ -0,0 +1,13 @@
+// PR c++/22434
+// { dg-options "" }
+
+struct A
+{
+ A(void*);
+ ~A();
+};
+
+void foo(const int i, bool b)
+{
+ b ? A(0) : i; // { dg-error "conversion|initializing" }
+}