// { 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" "" { target c++17_down } } }; 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" } A::X<&i, &f, &f> apple3; // { dg-error "wrong number of template arguments" "wrong number" } A apple4; // { dg-prune-output "provided for" }