2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.pt / syntax1.C
blob4400ae297842955522d6d5ffec90bd231bf657b5
1 // { dg-do assemble  }
3 // Copyright (C) 2000 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 22 June 2000 <nathan@codesourcery.com>
6 // Origin GNATS bug report 262 from Jeremy Sanders <jss@ast.cam.ac.uk>
7 // and several others. With templates, it's very easy to say something
8 // erroneous like
9 //    template class X::X<whatever>
10 // The culprit
11 //    ... class X::X ...
12 // caused us to ICE as we got confused about pushing and popping scopes.
16 class Y
18   public:
19   template <class T> Y(T &);
21 template <class T> Y::Y(T &) {}
23 template class Y::Y (int);  // { dg-error "" } parse error
24 template Y::Y (int);        // { dg-error "" } template-id does not match
25 template Y::Y (int &);