This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/17431] [3.4/4.0 regression] Internal error: Segmentation fault (program cc1plus)
- From: "nathan at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 14 Sep 2004 17:40:17 -0000
- Subject: [Bug c++/17431] [3.4/4.0 regression] Internal error: Segmentation fault (program cc1plus)
- References: <20040912055243.17431.yoav.frandzel@intel.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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