aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/conversion/cond6.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.dg/conversion/cond6.C')
-rw-r--r--gcc/testsuite/g++.dg/conversion/cond6.C18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/conversion/cond6.C b/gcc/testsuite/g++.dg/conversion/cond6.C
new file mode 100644
index 00000000000..8c05e1b143c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/conversion/cond6.C
@@ -0,0 +1,18 @@
+// PR c++/11283
+// Converting "a" to the type of "i" produces "int" rather than "const
+// int", which was causing build_conditional_expr to abort. But we don't
+// care about cv-quals on non-class rvalues.
+
+struct A
+{
+ operator int ();
+};
+
+extern A a;
+extern const int i;
+extern bool b;
+
+int f ()
+{
+ return b ? a : i;
+}