Commit 84a3423b by Nathan Sidwell Committed by Nathan Sidwell

re PR c++/65936 (ICE: canonical types differ for identical types)

	cp/
	PR c++/65936
	* pt.c (lookup_template_class_1): Copy may_alias attribute too.

	testsuite/
	PR c++/65936
	* g++.dg/template/pr65936.C: New.

From-SVN: r223613
parent 94cbafd1
2015-05-23 Nathan Sidwell <nathan@acm.org>
PR c++/65936
* pt.c (lookup_template_class_1): Copy may_alias attribute too.
2015-05-22 Jim Wilson <jim.wilson@linaro.org> 2015-05-22 Jim Wilson <jim.wilson@linaro.org>
* Make-lang.in (check_g++_parallelize): Update comment. * Make-lang.in (check_g++_parallelize): Update comment.
......
...@@ -7905,15 +7905,22 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context, ...@@ -7905,15 +7905,22 @@ lookup_template_class_1 (tree d1, tree arglist, tree in_decl, tree context,
if (OVERLOAD_TYPE_P (t) if (OVERLOAD_TYPE_P (t)
&& !DECL_ALIAS_TEMPLATE_P (gen_tmpl)) && !DECL_ALIAS_TEMPLATE_P (gen_tmpl))
{ {
if (tree attributes static const char *tags[] = {"abi_tag", "may_alias"};
= lookup_attribute ("abi_tag", TYPE_ATTRIBUTES (template_type)))
for (unsigned ix = 0; ix != 2; ix++)
{ {
if (!TREE_CHAIN (attributes)) tree attributes
= lookup_attribute (tags[ix], TYPE_ATTRIBUTES (template_type));
if (!attributes)
;
else if (!TREE_CHAIN (attributes) && !TYPE_ATTRIBUTES (t))
TYPE_ATTRIBUTES (t) = attributes; TYPE_ATTRIBUTES (t) = attributes;
else else
TYPE_ATTRIBUTES (t) TYPE_ATTRIBUTES (t)
= build_tree_list (TREE_PURPOSE (attributes), = tree_cons (TREE_PURPOSE (attributes),
TREE_VALUE (attributes)); TREE_VALUE (attributes),
TYPE_ATTRIBUTES (t));
} }
} }
......
2015-05-23 Nathan Sidwell <nathan@acm.org>
PR c++/65936
* g++.dg/template/pr65936.C: New.
2015-05-22 Marc Glisse <marc.glisse@inria.fr> 2015-05-22 Marc Glisse <marc.glisse@inria.fr>
PR tree-optimization/63387 PR tree-optimization/63387
......
// checking ICE in canonical typing
class A;
template <typename> struct B
{
typedef A type;
};
template <class T> class C
: public B<T>::type
{
} __attribute__ ((__may_alias__));
class A
{
operator const C<int> &()
{
return *static_cast<const C<int> *> (this);
}
};
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