mirror of git://gcc.gnu.org/git/gcc.git
re PR c++/57610 (Reference initialized with temporary instead of sub-object of conversion result)
2015-04-30 Paolo Carlini <paolo.carlini@oracle.com> PR c++/57610 * g++.dg/init/ref22.C: New. From-SVN: r222615
This commit is contained in:
parent
ac9f18db1b
commit
d2db6b291e
|
|
@ -1,3 +1,8 @@
|
|||
2015-04-30 Paolo Carlini <paolo.carlini@oracle.com>
|
||||
|
||||
PR c++/57610
|
||||
* g++.dg/init/ref22.C: New.
|
||||
|
||||
2015-04-30 Marek Polacek <polacek@redhat.com>
|
||||
|
||||
* gcc.dg/init-bad-8.c: New test.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
// PR c++/57610
|
||||
// { dg-do run }
|
||||
|
||||
extern "C" void abort();
|
||||
|
||||
struct A
|
||||
{
|
||||
A() { }
|
||||
A(const A&) { abort(); }
|
||||
};
|
||||
|
||||
struct B : A { };
|
||||
|
||||
struct X
|
||||
{
|
||||
operator B() { return B(); }
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
X x;
|
||||
const A& r = x;
|
||||
}
|
||||
Loading…
Reference in New Issue