2 // { dg-options "-std=gnu++98" }
3 // Origin: <tilps at hotmail dot com>
4 // c++/9154: poor error message for ">>" vs "> >" in template argument list
8 * Test that the error message is issued properly
13 A<A<int>> blah; // { dg-error "should be '> >' within" }
14 A<int>> blah2; // { dg-error "spurious '>>'" }
18 * Test that a few valid constructs containing a ">>" token in a
19 * template argument list are handled correctly.
29 template <int N = 123>>4>
32 template <int> struct D {};
33 template <typename> struct E {};
40 template <int> struct F {
44 template <typename T = F< 1>>2 >::I>
48 * In this special case, a valid type-id (H() is a function type) is followed
49 * by '>>', but the argument should still be parsed as an expression, which
50 * will then be rejected as non-constant expression.
57 template <int V> struct L {};
58 L<H() >> 5> l; // { dg-error "" "non-constant" }
62 * This case used to not emit the nice error message because of a typo
65 template <void (*)(void)>
70 A<K<&KFunc>> k1; // { dg-error "" }
71 K<&KFunc>> k2; // { dg-error "" }