This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
typedef vs. typename confusion
- To: egcs at cygnus dot com
- Subject: typedef vs. typename confusion
- From: Fred Richardson <frichard at bbn dot com>
- Date: Mon, 3 Aug 1998 12:05:07 -0400
- Reply-to: frichard at bbn dot com
Hi-
I have some older template code (which is too big to paste here) which
used to compile and run with egcs-1.0.3 but breaks with the following
version of egcs off the 1.1 CVS branch:
% gcc -v
Reading specs from /d4mutl/bybrad.dev/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.52/specs
gcc version egcs-2.91.52 19980802 (gcc2 ss-980609 experimental)
%
The problem I found is that if I neglect to use typename in certain
places, the compiler will get confused and use a different (and on my
part unspecified) set of template parameters (currently for or in a
friend function) and complain that no match can be found for the
function I'm calling. Usually the function(s) it lists in the
possible matches have parameters for classes that I never instantiated
or specified anywhere else in the code.
I've been trying to come up with a small example, but I haven't been
able to. I have a pretty complicated template class hierarchy that
triggers this problem. I'll keep chiseling away at it, but I was
wondering if anyone else has seen this problem.
-Fred