2008/10/10 Peter A. Felvegi <[EMAIL PROTECTED]> > > Hello All, > > I've run into this: > > ----8<----8<----8<---- > template<typename F, typename A> > class B > { > protected: > static const int i = 42; > }; > > template<typename F, typename A> > class D : protected B<F, A> > { > public: > D(int n_ = B<F, A>::i); // line 12 > }; > ----8<----8<----8<---- > > gcc-4.1 and 4.3 give the same error message: > > t.cpp:12: error: expected ',' or '...' before '>' token > t.cpp:12: error: wrong number of template arguments (1, should be 2) > t.cpp:2: error: provided for 'template<class F, class A> class B' > t.cpp:12: error: default argument missing for parameter 2 of 'D<F, A>::D(int, > A)' > > If I write D(int n_ = (B<F, A>::i) ), then it compiles. Imho it should > compile w/o the extra parentheses. VC++ 2008 Express compiled it. Wanted to > test gcc 4.4, too, but I wasn't able to compile the 20081003 snapshot > (/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or > directory). I have a debian lenny/amd64 system. > > Regards, P
Your example compiles without errors with a gcc built on Mac OS X 10.4 from recent svn head (revision 140993, from Wednesday). -- James