Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / g++.dg / template / local1.C
blob4293aca2403694210591ccfd7b008e20532bd519
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> ();