cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1999/09/21/03:24:08

X-Authentication-Warning: ieva01.lanet.lv: pavenis owned process doing -bs
Date: Tue, 21 Sep 1999 10:04:49 +0300 (WET)
From: Andris Pavenis <pavenis AT lanet DOT lv>
To: Jari Karppinen <jakarppi AT paju DOT oulu DOT fi>
cc: djgpp AT delorie DOT com
Subject: Re: Trouble with templates and gcc-2.95
In-Reply-To: <7s586n$k60$1@ousrvr3.oulu.fi>
Message-ID: <Pine.A41.4.05.9909210954060.53478-100000@ieva01.lanet.lv>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com


On 20 Sep 1999, Jari Karppinen wrote:

> I wrote a simple templatized vector class. There was no trouble 
> compiling the source with egcs-1.1.2, but after I switched to 
> gcc-2.95, I got the following:
> 
> vec.cc: In instantiation of `Vector<int>':
> vec.cc:285:   instantiated from here
> vec.cc:44: invalid use of undefined type `class Vector<int>'
> vec.cc:48: forward declaration of `class Vector<int>'
> vec.cc:44: confused by earlier errors, bailing out
>  
> I made no changes to the source, and can't see why this happens. I would
> really appreciate advice from experts.
 
I cannot answer why this happens. At least I have verified in Linux that
it's so (gcc-2.95.1 gives errors, egcs-2.91.66.1 compiles Ok). It's known
that newer versions of gcc does more strict syntactical checking of source
and as result there may be problems. Use of option -fpermissive to turn
off default -fpedantic-errors for C++ compiler also doesn't help in this
case.

I suggest making smaller test example (to be more sure somebody will take
a look at it) and to ask a question in gcc mailing list (gcc AT gcc DOT gnu DOT org).

Andris

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019