This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/17431] [3.4/4.0 regression] Internal error: Segmentation fault (program cc1plus)


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]