[Bug c++/17431] [3.4/4.0 regression] Internal error: Segmentation fault (program cc1plus)
nathan at gcc dot gnu dot org
gcc-bugzilla@gcc.gnu.org
Tue Sep 14 17:40:00 GMT 2004
------- Additional Comments From nathan at gcc dot gnu dot org 2004-09-14 17:40 -------
Hey, guess what, the test case isn't invalid (or the std does not say what it
means).
struct B : A
{
B(int);
B(B&);
B(A);
};
In the call to foo, we have to copy the rvalue temp created by B::B(int) --
this copy & temp can and will be elided, but we must check that it is doable.
B::B(B&) can't do this, because it has a non-const reference arg, but, B(A) can
do it via A's implicit const-copy constructor.
EDG 3.4 rejects this code though, and one of our auto_ptr testcases now
compiles, due to such a 'sideways' copy path. I'm clarifying with EDG as
to what the intent of the std is.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17431
More information about the Gcc-bugs
mailing list