aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/lvalue2.C
blob: 2fba73c9c87c74700dc4d2f8465698dda055d0e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// PRMS Id: 4892
// Bug: COND_EXPRs, MODIFY_EXPRs and COMPOUND_EXPRs aren't properly recognized
// as lvalues.
// Build don't link:

extern int foo;
int& f (int& a, int& b)
{
  return (foo ? a : b);		// gets bogus error - 
}

int& g (int& a)
{
  return (a = 0);		// gets bogus error - 
}

int& h (int& a, int& b)
{
  return (a = 1, b);		// gets bogus error - 
}