1// { dg-do assemble } 2 3// Copyright (C) 2000 Free Software Foundation, Inc. 4// Contributed by Nathan Sidwell 23 June 2000 <nathan@codesourcery.com> 5 6// Origin GNATS bug report 10 from Ewgenij Gawrilow <gawrilow@math.TU-Berlin.DE> 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 11template <int> class C { }; 12 13void f() 14{ 15C<1> c1; 16C<1 & 2> c2; 17C<1>2> c3; // { dg-error "" } parse error 18C<(1>2)> c4; 19C<1 & 2>2> c5; // { dg-error "" } parse error 20C<1 & (2>2)> c6; 21} 22 23template <int i = 3>4 > class X1 {}; // { dg-error "" } parse error 24template <int i = 3&&4>0 > class X2 {}; // { dg-error "" } parse error 25template <int i = 3&&4 > class X3 {}; 26template <int i = (3>4) > class X4 {}; 27