2015-08-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53421
* g++.dg/ext/attribute-may-alias-1.C: New.
* g++.dg/ext/attribute-may-alias-2.C: Likewise.
From-SVN: r226868
+2015-08-13 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/53421
+ * g++.dg/ext/attribute-may-alias-1.C: New.
+ * g++.dg/ext/attribute-may-alias-2.C: Likewise.
+
2015-08-13 Matthew Wahab <matthew.wahab@arm.com>
* gcc.target/aarch64/atomic-inst-cas.c: New.
--- /dev/null
+// PR c++/53421
+
+template< class T >
+struct Y : T
+{ } __attribute__((__may_alias__));
+
+struct X
+{
+ operator Y<X>& () { return *static_cast< Y<X>* >(this); }
+};
+
+int main()
+{
+ &X::operator Y<X>&;
+}
--- /dev/null
+// PR c++/53421
+
+template< class T >
+struct Y : T
+{ } __attribute__((__may_alias__));
+
+struct X
+{
+ operator Y<X>& ();
+};
+
+Y<X> y = Y<X>();
+X::operator Y<X>& () { return *static_cast< Y<X>* >(this); }