new
From-SVN: r29761
This commit is contained in:
parent
edf4b387c0
commit
1bd83869f2
14
gcc/testsuite/g++.old-deja/g++.other/cond6.C
Normal file
14
gcc/testsuite/g++.old-deja/g++.other/cond6.C
Normal file
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user