summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/parse10.C
blob: 751928a2b85462ac42ab16a2dd84a4cb6e4e6b4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// { dg-do run  }
// Testcase for precedence of ?: wrt =

extern "C" int printf (const char *, ...);

int main()
{
  int j = 0, k = 0;
  1 ? j : k = 5;		// should be parsed 1 ? j : (k = 5)
  (void) (1 ? k = 5 : 0);
  k = 5 ? 1 : 0;		// should be parsed k = (5 ? 1 : 0)

  printf ("%d %d\n", j, k);

  return j == 5 || k == 5;
}