🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.bug
Article #177

What happened to the default copy constructor?

#177
From: Christos Zoulas
Date: Mon, 27 Jul 1992 17:21
28 lines
1270 bytes
This code works fine on cfront, but fails when compiled with g++-2.2.2

% cat foo
class foo {
  public:
   foo(int bar) { _bar = bar; }
  private:
   int _bar;
};


main()
{
   foo f(1);
   foo *g = new foo(f);
}

% g++ foo.C
Reading specs from /usr/local/lib/gcc-lib/sparc/2.2.2/specs
gcc version 2.2.2
 /usr/local/lib/gcc-lib/sparc/2.2.2/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix foo.C /usr/tmp/cca02812.i
GNU CPP version 2.2.2 (sparc)
 /usr/local/lib/gcc-lib/sparc/2.2.2/cc1plus /usr/tmp/cca02812.i -quiet -dumpbase foo.cc -version -o /usr/tmp/cca02812.s
GNU C++ version 2.2.2 (sparc) compiled by GNU C version 2.2.2.
foo.C: In function `int  main ()':
foo.C:14: bad argument 0 for function `foo::foo (int)' (type was class foo)

christos
Technical Details
Message-ID: <1992Jul27.172128.3103@deshaw>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!deshaw.UUCP!christos

Show Full Headers
Complete Article Headers
Newsgroups: gnu.g++.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!deshaw.UUCP!christos
From: christos@deshaw.UUCP (Christos Zoulas)
Subject: What happened to the default copy constructor?
Message-ID: <1992Jul27.172128.3103@deshaw>
Sender: gnulists@ai.mit.edu
Organization: D. E. Shaw & Co.
Distribution: gnu
Date: Mon, 27 Jul 1992 17:21:28 GMT
Approved: bug-g++@prep.ai.mit.edu
Lines: 29