OSDN Git Service

fix
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.old-deja / g++.other / cond6.C
1 // Test that the result of `x ? const E : E' is an E rvalue.
2 // Contributed by Jason Merrill <jason@cygnus.com>
3
4 enum E { a };
5
6 bool b;
7
8 int main ()
9 {
10   E e1 = a;
11   const E &er = e1;
12   E e2 = b ? er : a;            // OK
13   const E* ep = &(b ? er : a);  // ERROR - non-lvalue
14 }