diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2015-08-13 15:45:37 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2015-08-13 15:45:37 +0000 |
commit | 42b7febc53cac744c7d0c0ae6e2dae0876b7d896 (patch) | |
tree | 6cc568b30f24a1a758897c2521dea2237ac29af6 | |
parent | 708768eb18c58c100a91f114c556a2c39cb1f0f4 (diff) | |
download | gcc-42b7febc53cac744c7d0c0ae6e2dae0876b7d896.zip gcc-42b7febc53cac744c7d0c0ae6e2dae0876b7d896.tar.gz gcc-42b7febc53cac744c7d0c0ae6e2dae0876b7d896.tar.bz2 |
re PR c++/53421 (__attribute__((__may_alias__)) prevents taking address of conversion operator member function)
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
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/attribute-may-alias-1.C | 15 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/ext/attribute-may-alias-2.C | 13 |
3 files changed, 34 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8c19d68..ef2d567 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +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. diff --git a/gcc/testsuite/g++.dg/ext/attribute-may-alias-1.C b/gcc/testsuite/g++.dg/ext/attribute-may-alias-1.C new file mode 100644 index 0000000..24d2aab --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attribute-may-alias-1.C @@ -0,0 +1,15 @@ +// 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>&; +} diff --git a/gcc/testsuite/g++.dg/ext/attribute-may-alias-2.C b/gcc/testsuite/g++.dg/ext/attribute-may-alias-2.C new file mode 100644 index 0000000..d7e1fdf --- /dev/null +++ b/gcc/testsuite/g++.dg/ext/attribute-may-alias-2.C @@ -0,0 +1,13 @@ +// 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); } |