aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2018-05-15 17:56:29 -0400
committerJason Merrill <jason@gcc.gnu.org>2018-05-15 17:56:29 -0400
commit30a52a6d629ebe46c788940c1cbe518e4d5cbd5a (patch)
tree33a71d286617d3c0aadf84776d61d8355ec2e226 /gcc/testsuite/g++.dg
parent275605696b6754f178af04ef6187b1faed6092e9 (diff)
downloadgcc-30a52a6d629ebe46c788940c1cbe518e4d5cbd5a.zip
gcc-30a52a6d629ebe46c788940c1cbe518e4d5cbd5a.tar.gz
gcc-30a52a6d629ebe46c788940c1cbe518e4d5cbd5a.tar.bz2
PR c++/64372 - CWG 1560, gratuitous lvalue-rvalue conversion in ?:
* call.c (build_conditional_expr_1): Don't force_rvalue when one arm is a throw-expression. From-SVN: r260272
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r--gcc/testsuite/g++.dg/cpp1y/dr1560.C14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp1y/dr1560.C b/gcc/testsuite/g++.dg/cpp1y/dr1560.C
new file mode 100644
index 0000000..b21ca98
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp1y/dr1560.C
@@ -0,0 +1,14 @@
+// Core 1560
+// { dg-do compile { target c++14 } }
+
+struct A
+{
+ A();
+ A(const A&) = delete;
+};
+
+void f(bool b)
+{
+ A a;
+ b ? a : throw 42;
+}