[Bug c++/66686] Instantiation of dependent template template parameter with non-dependent template rejected

ppalka at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jun 30 19:50:00 GMT 2015


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.



More information about the Gcc-bugs mailing list