This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
typedef scoping within templates
- To: egcs-bugs at egcs dot cygnus dot com
- Subject: typedef scoping within templates
- From: Frank Swenton <fswenton at math dot Princeton dot EDU>
- Date: Sat, 26 Jun 1999 13:56:05 -0400 (EDT)
References to typedef'ed class names from within a template don't
compile, although this does work _outside_ of templates. This appears to
be the case in both the official-release egcs and 2.95 as well. Example
below--the first "::" definitely compiles; the second, I haven't tried
yet; the third does not compile (doesn't recognize T::DataType).
=====
struct A { typedef int DataType; };
A::DataType d; // Compiles
class Boo { A::DataType d; }; // Compiles (I presume--should, anyway)
template<class T> class Bleah {
T::DataType d; // Does not compile
};
Bleah<A> b; // (Just to instantiate template)
=====
If you could let me know whether this is some sort of known behaviour or
simply a bug, I'd greatly appreciate it--thanks!
Frank Swenton
fswenton@math.princeton.edu