"redefinition" of template default argument causes error on egcs 1.1b (no error on 2.8.1)
Corey Kosak
kosak@cs.cmu.edu
Tue Sep 8 12:41:00 GMT 1998
% cat test.cc && g++ -v && g++ test.cc && echo ok && g++ -DBUG test.cc
template<typename T=int> struct cow; //forward declaration
#ifdef BUG
template<typename T=int> struct cow { T data; };
#else
template<typename T> struct cow { T data; };
#endif
int main()
{
cow<> x;
}
Reading specs from /afs/cs.cmu.edu/project/cmcl-kosak/various-gcc/egcs-1.1b/i386_linux2/lib/gcc-lib/i686-pc-linux-gnulibc1/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
ok
test.cc:4: redefinition of default argument for `class T'
test.cc:1: original definition appeared here
More information about the Gcc-bugs
mailing list