public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/17227] New: Default copy constructor being created although never invoked
@ 2004-08-29 12:29 igodard at pacbell dot net
  2004-08-29 14:49 ` [Bug c++/17227] " giovannibajo at libero dot it
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: igodard at pacbell dot net @ 2004-08-29 12:29 UTC (permalink / raw)
  To: gcc-bugs

I have a test case where the compiler is trying to build a default copy ctor and failing because the class has an un-copyable member. However, the class is never copied. Adding an explicit copy ctor to the class makes the problem go away, and that ctor is never called either (all uses are by reference; it's not that the ctor is optimized away).

However, the case is big and complicated, so rather than put in the work of isolating the source code I'm first asking whether this is expected behavior: must a copy ctor be supplied when the compiler-built one is impossible, even if the ctor is never used? And if this actually is bogus, do you already have a bug report on it?

Ivan
Ivan

-- 
           Summary: Default copy constructor being created although never
                    invoked
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: igodard at pacbell dot net
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17227


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/17227] Default copy constructor being created although never invoked
  2004-08-29 12:29 [Bug c++/17227] New: Default copy constructor being created although never invoked igodard at pacbell dot net
@ 2004-08-29 14:49 ` giovannibajo at libero dot it
  2004-08-29 20:42 ` igodard at pacbell dot net
  2004-10-11 17:57 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: giovannibajo at libero dot it @ 2004-08-29 14:49 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From giovannibajo at libero dot it  2004-08-29 14:49 -------
We can't comment without source code. Again, please ask similar questions in 
newsgroups or forums, not here.

Anyway, this looks like the usual problem with binding rvalues to temporary. 
Please consult http://gcc.gnu.org/bugs.html#cxx_rvalbind.

Otherwise, attacch a possibly reduced preprocessed source.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17227


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/17227] Default copy constructor being created although never invoked
  2004-08-29 12:29 [Bug c++/17227] New: Default copy constructor being created although never invoked igodard at pacbell dot net
  2004-08-29 14:49 ` [Bug c++/17227] " giovannibajo at libero dot it
@ 2004-08-29 20:42 ` igodard at pacbell dot net
  2004-10-11 17:57 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: igodard at pacbell dot net @ 2004-08-29 20:42 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From igodard at pacbell dot net  2004-08-29 20:42 -------
Thank you. The explanation about binding rvalues to temps is exactly the case I'm seeing. I appreciate you taking the time for the comment; your note saved me the better part of a day reducing this - it's hard to reduce when you don't know what it is you're reducing :-)

Ivan

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17227


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/17227] Default copy constructor being created although never invoked
  2004-08-29 12:29 [Bug c++/17227] New: Default copy constructor being created although never invoked igodard at pacbell dot net
  2004-08-29 14:49 ` [Bug c++/17227] " giovannibajo at libero dot it
  2004-08-29 20:42 ` igodard at pacbell dot net
@ 2004-10-11 17:57 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-10-11 17:57 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-10-11 17:57 -------
*** Bug 17938 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bryner at brianryner dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17227


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-11 17:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-29 12:29 [Bug c++/17227] New: Default copy constructor being created although never invoked igodard at pacbell dot net
2004-08-29 14:49 ` [Bug c++/17227] " giovannibajo at libero dot it
2004-08-29 20:42 ` igodard at pacbell dot net
2004-10-11 17:57 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).