summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/cond6.C
blob: db018a4a3014867975b9f015570c95af166aa0b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// { dg-do assemble  }
// 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);	// { dg-error "" } non-lvalue
}