home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!gumby!wupost!cs.uiuc.edu!sparc0b!pjl
- From: pjl@cs.uiuc.edu (Paul Lucas)
- Subject: Re: Compiler Bug (AT&T 2.1) ?
- Message-ID: <BxvtFL.CnL@cs.uiuc.edu>
- Keywords: declaration constructor
- Sender: news@cs.uiuc.edu
- Organization: University of Illinois at Urbana-Champaign
- References: <1992Nov17.181306.8081@lut.ac.uk>
- Date: Tue, 17 Nov 1992 22:35:45 GMT
- Lines: 59
-
- In <1992Nov17.181306.8081@lut.ac.uk> J.March@lut.ac.uk writes:
-
- >Consider this:
-
- > ______ start file.c _______
- >class Elt
- >{
- >public:
- > Elt(int*);
- > Elt(const Elt&);
- > Elt& operator=(const Elt&);
- > ~Elt();
- >};
-
-
-
- >class List
- >{
- >public:
- > List();
- > List(const Elt&);
- > List(const List&);
- > List& operator=(const List&);
- > ~List();
- >};
-
-
- >void main()
- >{
- > List L(new int(1));
- >}
-
-
- > ______ end file.c _______
-
- >compiled with:
-
- > CC +w file.c
-
- >to give:
-
- >ld: Undefined symbol
- > Elt::Elt(int*)
- > List::~List()
- > Elt::~Elt()
- > List::List(const Elt&)
- >Compilation failed
-
- >Fair enough,
-
- >BUT: Shouldn't this fail because the declaration of L doesn't match any of
- > the constructors for class List?
-
-
- *****> But List knows it can make an Elt const& from an int*, so "no."
- --
- - Paul J. Lucas University of Illinois
- AT&T Bell Laboratories at Urbana-Champaign
- Naperville, IL pjl@cs.uiuc.edu
-