This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/14140] Unwanted call to derived constructor after implicit conversion
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 Apr 2004 02:06:04 -0000
- Subject: [Bug c++/14140] Unwanted call to derived constructor after implicit conversion
- References: <20040213140825.14140.christian.engstrom@glindra.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-04-28 02:06 -------
Well I made the derived copy construtor private and I noticed that ICC errors out that the
copy construtor is inaccessible.
pr14140.cc
pr14140.cc(56): error #373: "derived::derived(const derived &)" is inaccessible
func((d_handle)); // Calls 'derived' copy constructor with gcc (only)
^
pr14140.cc(56): error #373: "derived::derived(const derived &)" is inaccessible
func((d_handle)); // Calls 'derived' copy constructor with gcc (only)
^
compilation aborted for pr14140.cc (code 2)
GCC does the thing, so this is not wrong-code at all as it is allowed by the standard to
call the copy construtor here.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14140