From: Jason Merrill Date: Sat, 2 Oct 1999 00:41:00 +0000 (-0400) Subject: new X-Git-Tag: prereleases/libstdc++-2.92~10265 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1bd83869f2434d184202618f1d086068d4a01bb6;p=thirdparty%2Fgcc.git new From-SVN: r29761 --- 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 000000000000..a462c4069bd4 --- /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 +}