Merged revisions 196716,196830,198094,198116,198502,198877,199007,199262,199319,19946...
[official-gcc.git] / main / gcc / testsuite / g++.dg / template / arrow3.C
blobb2029ba4894d749dfbfd4ec2e65d37bcb13b07dc
1 // PR c++/56895
2 // { dg-do compile }
4 extern struct A { bool foo (); A bar (); } *a;
6 template <int>
7 int
8 baz1 ()
10   return 2 << (a->bar().foo() ? 1 : 0);
13 template <int>
14 int
15 baz2 ()
17   return 2 >> (a->bar().foo() ? 1 : 0);
20 template <int>
21 int
22 baz3 ()
24   return 10 / (a->bar().foo() ? 1 : 2);
27 template <int>
28 int
29 baz4 ()
31   return 10 % (a->bar().foo() ? 1 : 0);
34 int
35 test ()
37   return baz1<0> () + baz2<0> () + baz3<0> () + baz4<0> ();