This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

"redefinition" of template default argument causes error on egcs 1.1b (no error on 2.8.1)


% 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]