This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/66686] Instantiation of dependent template template parameter with non-dependent template rejected
- From: "ppalka at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 30 Jun 2015 20:24:12 +0000
- Subject: [Bug c++/66686] Instantiation of dependent template template parameter with non-dependent template rejected
- Auto-submitted: auto-generated
- References: <bug-66686-4 at http dot gcc dot gnu dot org/bugzilla/>
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.