public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/15098] New: Explicit keyword forbids passing of temporary objects
@ 2004-04-23 11:35 bartosch at or dot uni-bonn dot de
  2004-04-23 11:41 ` [Bug c++/15098] " pinskia at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: bartosch at or dot uni-bonn dot de @ 2004-04-23 11:35 UTC (permalink / raw)
  To: gcc-bugs

The following code does not compile with 3.4.0: 
 
class EXP { 
public: 
   EXP() {} 
   explicit EXP( EXP const & other)  {} 
}; 
 
void f(EXP const & o) {} 
 
int main() { 
   EXP p1; 
   f(p1); 
   f(EXP()); 
} 
 
It used to compile with 3.3.x and still compiles with icc 8.x, Comeau 4.3.x, 
xlC 6.x.  
 
The error is:  
 
expli.C:12: error: no matching function for call to `EXP::EXP(const EXP&)' 
 
I do not see the need to call EXP::EXP(const EXP&) in line 12: 
 
   f(EXP()); 
 
A temporary is created and is passed by reference to f(). 
 
I could not find any hint that the new gcc behaviour is more standard 
compliant than the old one.

-- 
           Summary: Explicit keyword forbids passing of temporary objects
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bartosch at or dot uni-bonn dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c++/15098] Explicit keyword forbids passing of temporary objects
  2004-04-23 11:35 [Bug c++/15098] New: Explicit keyword forbids passing of temporary objects bartosch at or dot uni-bonn dot de
@ 2004-04-23 11:41 ` pinskia at gcc dot gnu dot org
  2004-04-23 12:26 ` bartosch at or dot uni-bonn dot de
  2004-04-23 12:33 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-23 11:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-23 11:21 -------
IIRC the following URL applies: <http://gcc.gnu.org/bugs.html#cxx_rvalbind>.

-- 


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


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

* [Bug c++/15098] Explicit keyword forbids passing of temporary objects
  2004-04-23 11:35 [Bug c++/15098] New: Explicit keyword forbids passing of temporary objects bartosch at or dot uni-bonn dot de
  2004-04-23 11:41 ` [Bug c++/15098] " pinskia at gcc dot gnu dot org
@ 2004-04-23 12:26 ` bartosch at or dot uni-bonn dot de
  2004-04-23 12:33 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: bartosch at or dot uni-bonn dot de @ 2004-04-23 12:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bartosch at or dot uni-bonn dot de  2004-04-23 11:44 -------
Ok, I see.  Feel free to close and forget this bug.  

-- 


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


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

* [Bug c++/15098] Explicit keyword forbids passing of temporary objects
  2004-04-23 11:35 [Bug c++/15098] New: Explicit keyword forbids passing of temporary objects bartosch at or dot uni-bonn dot de
  2004-04-23 11:41 ` [Bug c++/15098] " pinskia at gcc dot gnu dot org
  2004-04-23 12:26 ` bartosch at or dot uni-bonn dot de
@ 2004-04-23 12:33 ` pinskia at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-04-23 12:33 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-04-23 11:50 -------
So it was related to that and so this is not a bug so closing.

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


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


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

end of thread, other threads:[~2004-04-23 11:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-23 11:35 [Bug c++/15098] New: Explicit keyword forbids passing of temporary objects bartosch at or dot uni-bonn dot de
2004-04-23 11:41 ` [Bug c++/15098] " pinskia at gcc dot gnu dot org
2004-04-23 12:26 ` bartosch at or dot uni-bonn dot de
2004-04-23 12:33 ` 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).