[PR c++/84702] ICE with default tmpl arg of overload set
[official-gcc.git] / gcc / testsuite / g++.dg / template / local1.C
blob58f96b423b1cf8106531c4571d941d54fa0af935
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> ();