Commit 42c729c5 by Marek Polacek Committed by Marek Polacek

re PR c++/70209 (ICE in strip_typedefs, at cp/tree.c:1377)

	PR c++/70209
	* tree.c (strip_typedefs): Call strip_typedefs again on the
	DECL_ORIGINAL_TYPE result.

	* g++.dg/ext/attribute-may-alias-4.C: New test.

From-SVN: r234234
parent d1ccf407
2016-03-15 Marek Polacek <polacek@redhat.com>
PR c++/70209
* tree.c (strip_typedefs): Call strip_typedefs again on the
DECL_ORIGINAL_TYPE result.
2016-03-15 Jason Merrill <jason@redhat.com>
PR c++/70095
......
......@@ -1460,9 +1460,12 @@ strip_typedefs (tree t, bool *remove_attributes)
if (!result)
{
if (typedef_variant_p (t))
/* Explicitly get the underlying type, as TYPE_MAIN_VARIANT doesn't
strip typedefs with attributes. */
result = TYPE_MAIN_VARIANT (DECL_ORIGINAL_TYPE (TYPE_NAME (t)));
{
/* Explicitly get the underlying type, as TYPE_MAIN_VARIANT doesn't
strip typedefs with attributes. */
result = TYPE_MAIN_VARIANT (DECL_ORIGINAL_TYPE (TYPE_NAME (t)));
result = strip_typedefs (result);
}
else
result = TYPE_MAIN_VARIANT (t);
}
......
2016-03-15 Marek Polacek <polacek@redhat.com>
PR c++/70209
* g++.dg/ext/attribute-may-alias-4.C: New test.
2016-03-15 Alexander Monakov <amonakov@ispras.ru>
* g++.dg/pr63384.C: Add -w to dg-options. Remove '-toggle' in
......
// PR c++/70209
struct V {
typedef float F;
template <typename S> void m_fn1(S);
};
template <typename> struct A {
typedef V::F Ta __attribute__((__may_alias__));
Ta *m_data;
void m_fn2(V &);
};
template <>
void A<int>::m_fn2(V &p) {
p.m_fn1(m_data);
}
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