home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!spool.mu.edu!agate!doc.ic.ac.uk!daresbury!mrccrc!warwick!nott-cs!lut.ac.uk!cojm2
- From: J.March@lut.ac.uk
- Subject: Compiler Bug (AT&T 2.1) ?
- Message-ID: <1992Nov17.181306.8081@lut.ac.uk>
- Keywords: declaration constructor
- Reply-To: J.March@lut.ac.uk (Jonathan March)
- Organization: Loughborough University, UK.
- Date: Tue, 17 Nov 92 18:13:06 GMT
- Lines: 55
-
- 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?
-
-
- Jon March
-
-
-