public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* c++/3702: g++-3.0 copies constructors
@ 2001-07-16 18:36 Matthias Klose
  0 siblings, 0 replies; 2+ messages in thread
From: Matthias Klose @ 2001-07-16 18:36 UTC (permalink / raw)
  To: gcc-gnats, debian-gcc

>Number:         3702
>Category:       c++
>Synopsis:       g++-3.0 copies constructors
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Jul 16 18:36:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Jaakko Niemi <liiwi@iki.fi>
>Release:        3.0 (Debian GNU/Linux)
>Organization:
The Debian project
>Environment:
System: Debian GNU/Linux (testing/unstable)
Architecture: i686
	
host: i386-linux
build: i386-linux
target: i386-linux
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,proto,objc --prefix=/usr --infodir=/share/info --mandir=/share/man --enable-shared --with-gnu-as --with-gnu-ld --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --disable-checking --enable-threads=posix --enable-java-gc=boehm --with-cpp-install-dir=bin --enable-objc-gc i386-linux
>Description:
[ Reported to the Debian BTS as report #103980.
  Please CC 103980-quiet@bugs.debian.org on replies.
  Log of report can be found at http://bugs.debian.org/103980
  sfs report: http://www.mit.edu:8008/snafu.fooworld.org/sfs/116
]
 	

SFS (secure file system) fails to compile with gcc 3.0, and it was
tracked down to this example code that reproduces the error:

-------------
class aios {
  friend class aiosout;

public:
  aios ();
  ~aios ();
};

class aiosout {
  aiosout (const aiosout &o);
  aiosout &operator= (const aiosout &);
public:
  aiosout (aios &a) {}
  ~aiosout () {}
};

template<class T> inline const aiosout&
operator<< (const aiosout &o, const T &a)
{
  return o;
}

void fault(void)
{
  aios a;

  // normally a C++ compiler should resolve the following like this:
  //  tmp = aiosout(a)
  //  operator<< (tmp, 10);
  // apparently, g++ 3.0 tries to do something like this:
  //  tmp1 = aiosout(a)
  //  tmp2 = aiosout(tmp1)   <== copy constructor (unusable!)
  //  operator<< (tmp2, 10);
  // which is wasteful even when it works... maybe now we know why

  a << 10;
}
-----


>How-To-Repeat:
	
>Fix:
	
>Release-Note:
>Audit-Trail:
>Unformatted:


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

* Re: c++/3702: g++-3.0 copies constructors
@ 2001-08-12  8:45 gdr
  0 siblings, 0 replies; 2+ messages in thread
From: gdr @ 2001-08-12  8:45 UTC (permalink / raw)
  To: Laurent.Bonnaud, 103980-quiet, gcc-bugs, gcc-prs, gdr, liiwi, nobody

Synopsis: g++-3.0 copies constructors

Responsible-Changed-From-To: unassigned->gdr
Responsible-Changed-By: gdr
Responsible-Changed-When: Sun Aug 12 08:45:07 2001
Responsible-Changed-Why:
    See below.
State-Changed-From-To: open->closed
State-Changed-By: gdr
State-Changed-When: Sun Aug 12 08:45:07 2001
State-Changed-Why:
    Confirm as a horrible bug. A regression.  Duplicate of 3471.
    
    -- Gaby

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=3702&database=gcc


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

end of thread, other threads:[~2001-08-12  8:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-16 18:36 c++/3702: g++-3.0 copies constructors Matthias Klose
2001-08-12  8:45 gdr

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