new
authorJason Merrill <jason@gcc.gnu.org>
Sat, 2 Oct 1999 00:41:00 +0000 (20:41 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Sat, 2 Oct 1999 00:41:00 +0000 (20:41 -0400)
From-SVN: r29761

gcc/testsuite/g++.old-deja/g++.other/cond6.C [new file with mode: 0644]

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 (file)
index 0000000..a462c40
--- /dev/null
@@ -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
+}