2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / template / local1.C
blobf0897d4107dcce839fef18d4996046aac544eda0
1 // PR c++/4286: We were crashing when trying to set up the class bindings in
2 // g(), because xref wanted the mangled name, which breaks inside a template.
4 // Of course, the offending code is actually ill-formed anyway, so check
5 // for the error.  Also check that it's formatted properly.
7 struct A
9   template<class T> void f();
12 template<class T> void A::f()
14   struct B
15   {
16     void g() {}
17     static int x;       // { dg-error "static.*`int A::f\\(\\)::B::x'" "" }
18   };
21 int main ()
23   A a;
24   a.f<int> ();