* tree.c (strip_typedefs): Call strip_typedefs again on the
DECL_ORIGINAL_TYPE result.
* g++.dg/ext/attribute-may-alias-4.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@234234
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
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
--- /dev/null
+// 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);
+}