// { dg-do compile { target c++11 } } template class A { public: template class X { /* ... */ }; // { dg-error "not a valid type for a template non-type parameter" } }; template class B { public: template class X { typename A::template X foo; }; }; int i; float f; A::X<&i, &f> apple1; B::X<&i, &f> banana1; A::X<&i> apple2; // { dg-error "wrong number of template arguments" "wrong number" } // { dg-error "invalid type" "invalid" { target *-*-* } 22 } A::X<&i, &f, &f> apple3; // { dg-error "wrong number of template arguments" "wrong number" } // { dg-error "invalid type" "invalid" { target *-*-* } 24 } A apple4; // { dg-prune-output "provided for" }