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]

Re: -pedantic too pedantic about templates


> // sts@ica1.uni-stuttgart.de
> // should compile (with -pedantic) and return 0  

No, the code is ill-formed.

>   { return Outer<N-1>::Inner(n); }

This is a dependant name, so Outer<N-1>::Inner is considered as an
object; the whole thing should be function call (or operator()
invocation). As it turns out, Outer<1>::Inner is a type, so the
construct is ill-formed. The correct notation would be 

   { return typename Outer<N-1>::Inner(n); }

Hope this helps,
Martin


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