https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66686
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> --- Y takes a non-type template argument which isn't provided and can't be deduced in the instantiation (i.e., what would the value of N be in Y<N>?) Modifying the test case a bit to see the type Clang gives a.a shows that it winds up instantiating an object of type A<Y> even though no such type exists, indicating it's a Clang bug. $ cat t.cpp && /build/llvm-3.6.0/bin/clang++ -Wall -Wextra -Wpedantic t.cpptemplate <template <int> class> struct A { }; template <int> struct Y { }; template <class, class B, template <template <B> class> class C> struct X { C<Y> a; }; X<int, int, A> a; template <class T> void foo (T); int main () { foo (a.a); } /tmp/t-310f66.o: In function `main': t.cpp:(.text+0x9): undefined reference to `void foo<A<Y> >(A<Y>)' clang-3.6: error: linker command failed with exit code 1 (use -v to see invocation)