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 19:50:54 +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 #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to Patrick Palka from comment #2)
> (In reply to Martin Sebor from comment #1)
> > The code doesn't look valid to me: Y is not a valid template argument for
> > the template template parameter C.
>
> But once "struct X" gets instantiated like in the very last line, doesn't it
> become a valid template argument? There, B is set to int, thus the template
> parameter C gets the type "template <int> class" which is exactly the type
> of the template Y.
Err, I meant the parameter Z gets the type "template <int> class" which is
exactly the type of the template Y. So it seems that early-rejecting this
template definition is too pessimistic because there exist template arguments
that make the instantiated code valid.