Article View: gnu.g++.bug
Article #1075(none)
From: waterman
Date: Thu, 05 Nov 1992 14:06
Date: Thu, 05 Nov 1992 14:06
54 lines
1593 bytes
1593 bytes
Hi y'all,
I think I have discoverd an error of the gcc-Compiler, version 2.3.1.
The following piece of C++-code is the smallest program that causes
the problem:
// ptolink.h
template<class T>
class ptolink
{
private:
T* pointer;
public:
ptolink() { pointer = 0; }
ptolink(const ptolink& ptl) { pointer = 0; }
};
// Term.h
#include "ptolink.h"
typedef ptolink<int> intlink;
void a_function(intlink il);
// Term.C
#include "Term.h"
void a_function(intlink il)
{
a_function(il); // this is line 10
};
int main() {}
The Compiler produces the following message:
g++ -c Term.C -o Term
Term.C: In function `void a_function (class ptolink<int>)':
Term.C:10: no constructor named `ptolink' in visible scope
*** Error code 1
make: Fatal error: Command failed for target `Term'
It works fine if I don't define the copy-constructor in class ptolink
or if I declare a_function as "void a_function(const intlink& il)".
By the way, gcc 2.2.2 does not complain about the above program.
Bye, Rolf Watermann
Technical Details
Message-ID:
<1622.9211051206@infbsps3.ips.cs.tu-bs.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!hal.com!olivea!charnel!rat!usc!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ips.CS.tu-bs.DE!watermanShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!decwrl!hal.com!olivea!charnel!rat!usc!sdd.hp.com!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ips.CS.tu-bs.DE!waterman From: waterman@ips.CS.tu-bs.DE Newsgroups: gnu.g++.bug Subject: (none) Message-ID: <1622.9211051206@infbsps3.ips.cs.tu-bs.de> Date: 5 Nov 92 14:06:22 GMT Sender: gnulists@ai.mit.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 54 Approved: bug-g++@prep.ai.mit.edu