Debian Codegraph @

gcc/testsuite/g++.old-deja/g++.pt/expr8.C

raw
1 // { dg-do assemble }
2
3 // Copyright (C) 2000 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 23 June 2000 <[email protected]>
5
6 // Origin GNATS bug report 10 from Ewgenij Gawrilow <[email protected]>
7 // There is a grammar ambiguity with greater-than compare as a default
8 // template parameter value or template arg list. 14.2/2 and 14.1/15
9 // say how to resolve it, but we'd sometimes get it wrong.
10
11 template <int> class C { };
12
13 void f()
14 {
15 C<1> c1;
16 C<1 & 2> c2;
17 C<1>2> c3; // { dg-error "" } parse error
18 C<(1>2)> c4;
19 C<1 & 2>2> c5; // { dg-error "" } parse error
20 C<1 & (2>2)> c6;
21 }
22
23 template <int i = 3>4 > class X1 {}; // { dg-error "" } parse error
24 template <int i = 3&&4>0 > class X2 {}; // { dg-error "" } parse error
25 template <int i = 3&&4 > class X3 {};
26 template <int i = (3>4) > class X4 {};