🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Nate Osgood Sat, 23 Jan 1993 02:26
2.3.3 Template Interface Change/Bug?
#1400
Author: Nate Osgood
Date: Sat, 23 Jan 1993 02:26
67 lines
2528 bytes
Hi!  I'm a long-time user of g++ and of the g++ template system.  I was
quite surprised to find my template code responsible for many error
messages when I upgraded from gcc 2.2 to 2.3.3 (running on a Sun4
under SunOS 4.1.3).  I'm confident that the errors result from some
simple language spec change between the two versions of the compiler,
and I'm hoping to be able to modify my code accordingly.  I've
condensed the problem down to a minimal example.   

The problem concerns a report that there is no constructor present for
a template class in the visible scope.  It seems to occur when trying
to pass instances of the template class being complained about.
Here's the code:





template<class Contents> class A 
{
 public:
 A() {}
 A(A &t) {}
    
};


void    bar(A<int>);

int foo()
{
  A<int> foo;

  bar(foo);
 }



and here's the associatd compile

g++ -v /usr/tmp/foo.c
Reading specs from /usr/uns/lib/gcc-lib/sun4/2.3.3/specs
gcc version 2.3.3
 /usr/uns/lib/gcc-lib/sun4/2.3.3/cpp -lang-c++ -v -iprefix /usr/uns/lib/gcc-lib/sun4/2.2.2/sun4/2.3.3/ -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dsparc -Dsun -Dunix -D__sparc__ -D__sun__ -D__unix__ -D__sparc -D__sun -D__unix /usr/tmp/foo.c /usr/tmp/cca13992.i
GNU CPP version 2.3.3 (sparc)
 /usr/uns/lib/gcc-lib/sun4/2.3.3/cc1plus /usr/tmp/cca13992.i -quiet -dumpbase foo.cc -version -o /usr/tmp/cca13992.s
GNU C++ version 2.3.3 (sparc) compiled by GNU C version 2.3.3.
/usr/tmp/foo.c: In function `int  foo ()':
/usr/tmp/foo.c:16: no constructor named `A' in visible scope
/usr/tmp/foo.c:17: warning: control reaches end of non-void function

Compilation exited abnormally with code 1 at Wed Jan 20 22:54:35


-------------------


any ideas of what i'm missing?


thanks!

nate osgood
-- 
-------------------------------------------------------------------------------
Nate Osgood			| ARPA: hacrat@catfish.lcs.mit.edu
CS Graduate Student		| 
MIT LCS Room NE43-636		| UUCP: ...!uunet!catfish.lcs.mit.edu!hacrat
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads