Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.other / syntax4.C
blob7aed1f5b14070c963f49629bf9268e5247b8c248
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.
14 class X {
15   X ();
18 class Y {
19   public:
20   typedef ::X W;   // { dg-error "" } previous declaration
21   class Z;
24 class Y::Z {};
25 class Y::W  () {}  // { dg-error "" } parse error
26 Y::W::X () {}