aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Merrill <jason@gcc.gnu.org>1999-10-01 20:41:00 -0400
committerJason Merrill <jason@gcc.gnu.org>1999-10-01 20:41:00 -0400
commit1bd83869f2434d184202618f1d086068d4a01bb6 (patch)
tree3659377ffb73d7e9383a8c382a60d7c1a3f300fb
parentedf4b387c0bced0678c72c6f2ec632677a8f604c (diff)
downloadgcc-1bd83869f2434d184202618f1d086068d4a01bb6.zip
gcc-1bd83869f2434d184202618f1d086068d4a01bb6.tar.gz
gcc-1bd83869f2434d184202618f1d086068d4a01bb6.tar.bz2
new
From-SVN: r29761
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/cond6.C14
1 files changed, 14 insertions, 0 deletions
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 0000000..a462c40
--- /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 <jason@cygnus.com>
+
+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
+}