2 // Origin: Giovanni Bajo <giovannibajo at gcc dot gnu dot org>
3 // DR147: Naming the constructor (PR 11764)
8 struct B: public A { B(); };
14 A::A a; // { dg-error "" "the injected-class-name can never be found through qualified lookup" { xfail *-*-* } }
20 // This is nasty: if we allowed the injected-class-name to be looked as a
21 // qualified type, then the following code would be well-formed. Basically
22 // the last line is defining the static member (with redundant parenthesis).
23 // Instead, it should be rejected as a malformed constructor declaration.
25 template <class T> struct A {
26 template <class T2> A(T2);
29 template<> A<int>::A<int>(A<int>::x); // { dg-error "" "this is an invalid declaration of the constructor" { xfail *-*-* } }