Commit d808e92e by Jason Merrill Committed by Jason Merrill

DR 1286 PR c++/60328

	DR 1286
	PR c++/60328
	* pt.c (get_underlying_template): Fix equivalence calculation.

From-SVN: r208152
parent 3af78158
2014-02-25 Jason Merrill <jason@redhat.com>
DR 1286
PR c++/60328
* pt.c (get_underlying_template): Fix equivalence calculation.
2014-02-25 Adam Butcher <adam@jessamine.co.uk> 2014-02-25 Adam Butcher <adam@jessamine.co.uk>
PR c++/60311 PR c++/60311
......
...@@ -5185,9 +5185,12 @@ get_underlying_template (tree tmpl) ...@@ -5185,9 +5185,12 @@ get_underlying_template (tree tmpl)
tree sub = TYPE_TI_TEMPLATE (result); tree sub = TYPE_TI_TEMPLATE (result);
if (PRIMARY_TEMPLATE_P (sub) if (PRIMARY_TEMPLATE_P (sub)
&& (num_innermost_template_parms (tmpl) && (num_innermost_template_parms (tmpl)
== num_innermost_template_parms (sub)) == num_innermost_template_parms (sub)))
&& same_type_p (result, TREE_TYPE (sub)))
{ {
tree alias_args = INNERMOST_TEMPLATE_ARGS
(template_parms_to_args (DECL_TEMPLATE_PARMS (tmpl)));
if (!comp_template_args (TYPE_TI_ARGS (result), alias_args))
break;
/* The alias type is equivalent to the pattern of the /* The alias type is equivalent to the pattern of the
underlying template, so strip the alias. */ underlying template, so strip the alias. */
tmpl = sub; tmpl = sub;
......
// PR c++/60328
// { dg-require-effective-target c++11 }
template <class _T, class... _Rest>
struct Foo
{
template <class _TT, class... _RR>
using Bar = Foo<_TT, _RR...>;
using Normal = Foo<_Rest...>;
using Fail = Bar<_Rest...>;
};
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