Commit 1bd83869 by Jason Merrill

new

From-SVN: r29761
parent edf4b387
// 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
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment