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
This commit is contained in:
parent
708768eb18
commit
42b7febc53
3 changed files with 34 additions and 0 deletions
|
@ -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.
|
||||
|
|
15
gcc/testsuite/g++.dg/ext/attribute-may-alias-1.C
Normal file
15
gcc/testsuite/g++.dg/ext/attribute-may-alias-1.C
Normal file
|
@ -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>&;
|
||||
}
|
13
gcc/testsuite/g++.dg/ext/attribute-may-alias-2.C
Normal file
13
gcc/testsuite/g++.dg/ext/attribute-may-alias-2.C
Normal file
|
@ -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); }
|
Loading…
Add table
Reference in a new issue