Commit f58d5e06 by Patrick Palka

Fix PR c++/66686 (dependent template template substitution)

gcc/cp/ChangeLog:

	PR c++/66686
	* pt.c (coerce_template_template_parm) [PARM_DECL]: Don't
	return 0 if tsubst returns a dependent type.

gcc/testsuite/ChangeLog:

	PR c++/66686
	* g++.dg/template/pr66686.C: New test.

From-SVN: r225220
parent 5be6d9e4
2015-07-01 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/66686
* pt.c (coerce_template_template_parm) [PARM_DECL]: Don't
return 0 if tsubst returns a dependent type.
2015-06-30 Jason Merrill <jason@redhat.com>
PR debug/66653
......
......@@ -6363,11 +6363,13 @@ coerce_template_template_parm (tree parm,
D<int, C> d;
i.e. the parameter list of TT depends on earlier parameters. */
if (!uses_template_parms (TREE_TYPE (arg))
&& !same_type_p
(tsubst (TREE_TYPE (parm), outer_args, complain, in_decl),
TREE_TYPE (arg)))
return 0;
if (!uses_template_parms (TREE_TYPE (arg)))
{
tree t = tsubst (TREE_TYPE (parm), outer_args, complain, in_decl);
if (!uses_template_parms (t)
&& !same_type_p (t, TREE_TYPE (arg)))
return 0;
}
if (TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (arg))
&& !TEMPLATE_PARM_PARAMETER_PACK (DECL_INITIAL (parm)))
......
2015-07-01 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/66686
* g++.dg/template/pr66686.C: New test.
2015-06-30 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/lto17.ad[sb]: New test.
......
// PR c++/66686
template <int>
struct Y { };
template <class B, template <template <B> class Z> class C>
struct X
{
C<Y> a; // { dg-bogus "mismatch" }
};
template <template <int> class>
struct A { };
X<int, A> a;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment