From 1bd83869f2434d184202618f1d086068d4a01bb6 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Fri, 1 Oct 1999 20:41:00 -0400 Subject: [PATCH] new From-SVN: r29761 --- gcc/testsuite/g++.old-deja/g++.other/cond6.C | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/cond6.C diff --git a/gcc/testsuite/g++.old-deja/g++.other/cond6.C b/gcc/testsuite/g++.old-deja/g++.other/cond6.C new file mode 100644 index 00000000000..a462c4069bd --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/cond6.C @@ -0,0 +1,14 @@ +// Test that the result of `x ? const E : E' is an E rvalue. +// Contributed by Jason Merrill + +enum E { a }; + +bool b; + +int main () +{ + E e1 = a; + const E &er = e1; + E e2 = b ? er : a; // OK + const E* ep = &(b ? er : a); // ERROR - non-lvalue +} -- 2.30.2