https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66686

--- Comment #5 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #4)
> 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>?)

Can't you say that for all templates passed as arguments to template template
parameters?

> 
> 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.

I'm not sure I understand when you say that the type A<Y> does not exist.  I
can declare the variable "A<Y> zzz;" just fine, and I can declare a function
that takes an A<Y> as an argument, for example.  A<Y> seems like a standard
template.

> 
> $ 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)

Sorry for my misunderstanding, I can't quite see the problem here.

Reply via email to