This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Empty Template Classes
- To: egcs-bugs at cygnus dot com, jstern at citilink dot com
- Subject: Empty Template Classes
- From: Josh Stern <jstern at citilink dot com>
- Date: Wed, 7 Apr 1999 16:33:30 -0500 (CDT)
- Posted-Date: Wed, 7 Apr 1999 16:33:30 -0500 (CDT)
The following code used to compile with egcs and just stopped working
with the latest snapshot, I believe:
*****************************************************************
enum RGB_Status { AlreadyPixel, Indexed, OtherDirect };
template <RGB_Status O>
struct XITP3 {};
template <int N, RGB_Status O>
struct XITP13 {};
template <int N, bool R>
struct XITP12 {};
template <int N>
struct XITP1 {};
template <int N, bool R, RGB_Status O>
struct XITParam {
static XITP12<N,R> f12() throw() { return XITP12<N,R>(); }
static XITP13<N,O> f13() throw() { return XITP13<N,O>(); }
static XITP3<O> f3() throw() { return XITP3<O>(); }
static XITP1<N> f1() throw() { return XITP1<N>(); }
};
***********************************************************************
The error messages look like this:
../../VAG/X11/ImageRender.h:144: `XITP12' is not a template
../../VAG/X11/ImageRender.h:144: ANSI C++ forbids declaration `f12' with no type
../../VAG/X11/ImageRender.h:145: `XITP13' is not a template
../../VAG/X11/ImageRender.h:145: ANSI C++ forbids declaration `f13' with no type
../../VAG/X11/ImageRender.h:146: `XITP3' is not a template
../../VAG/X11/ImageRender.h:146: ANSI C++ forbids declaration `f3' with no type
../../VAG/X11/ImageRender.h:147: `XITP1' is not a template
../../VAG/X11/ImageRender.h:147: ANSI C++ forbids declaration `f1' with no type
referring to the functions in XITParam.
Is this new C++ strictness or a new bug?
Thanks for any info,
- Josh
jstern@citilink.com