This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: -pedantic too pedantic about templates
- To: sts at ica1 dot uni-stuttgart dot de
- Subject: Re: -pedantic too pedantic about templates
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sun, 23 May 1999 11:56:43 +0200
- CC: egcs-bugs at cygnus dot com
- References: <199905221954.VAA03809@boa.ica1.uni-stuttgart.de>
> // 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