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++/14140] Unwanted call to derived constructor after implicit conversion


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


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