This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Strange error message about a template class not being a class
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Strange error message about a template class not being a class
- From: Lutz Kettner <kettner at cs dot unc dot edu>
- Date: Thu, 21 Sep 2000 02:33:22 -0400 (EDT)
Bug report:
Compiler: g++ version 2.95.2 19991024 (release)
System: redhat Linux 6.1 on a Pentium III
Compiler call and messages:
++ design2.C
design2.C:17: `p_HDS<p_Items>' is not a class, struct, or union type
design2.C:17: syntax error before `{'
The program:
// design.2
// ------------------------------------------
template <class T>
struct HalfedgeDS {
typedef T* Handle;
};
template < class p_Items, template < class I> class p_HDS>
struct Polyhedron_3 {
typedef p_HDS< p_Items> HDS;
typedef typename HDS::Handle Handle;
void foo( Handle v );
};
template < class p_Items, template < class I> class p_HDS >
void Polyhedron_3<p_Items,p_HDS>::foo( Handle v) {}
int main() {
Polyhedron_3< int, HalfedgeDS> P;
int* v = 0;
P.foo( v);
return 0;
}
// EOF //
I have no workaround for this. Note, the Handle parameter and the
external definition are necessary to create that error message.
Best regards,
Lutz Kettner
----------------------------------------------------------------------
UNC Computer Science email: kettner@cs.unc.edu
CB 3175, Sitterson Hall phone: (919) 962-1846
Chapel Hill, NC 27599-3175, USA fax: (919) 962-1799
----------------------------------------------------------------------