aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/eval-order6.C
blob: c8fb0b6dc9c18269dcfea75963cd8d2ec47cd2f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// PR c++/91987
// { dg-do run }
// { dg-options "-fstrong-eval-order" }

int
foo ()
{
  int x = 5;
  int r = x << (x = 3, 2);
  if (x != 3)
    __builtin_abort ();
  return r;
}

int
main ()
{
  if (foo () != (5 << 2))
    __builtin_abort ();
}