[Bug c++/57] [DR 325] GCC can't parse a non-parenthesized comma in a template-id within a default argument
llewelly at xmission dot com
gcc-bugzilla@gcc.gnu.org
Fri Apr 30 16:44:00 GMT 2004
------- Additional Comments From llewelly at xmission dot com 2004-04-30 16:36 -------
Subject: Re: [DR 325] GCC can't parse a non-parenthesized comma in a template-id within a default argument
"bangerth at ices dot utexas dot edu" <gcc-bugzilla@gcc.gnu.org> writes:
> ------- Additional Comments From bangerth at ices dot utexas dot edu 2004-04-30 14:01 -------
> Subject: Re: [DR 325] GCC can't parse a non-parenthesized comma in a template-id within a default argument
>
>
> How funny, the reference is indeed in the standard, it's the last declaration
> on page 502, section 23.3.5.1. Maybe someone can see if there is a defect
> report, though I can't seem to find one if it exists.
>
> It's easy to work around, though, by just duplicating the constructor, and
> having one take the third argument and one not taking it.
[snip]
The default argument expression can also be parenthesized:
template<class charT, class traits, class Allocator>
explicit
bitset(const basic_string<charT, traits, Allocator>& str,
typename basic_string<charT, traits, Allocator>::size_type pos =0,
typename basic_string<charT, traits, Allocator>::size_type n =
(basic_string<charT, traits, Allocator>::npos));
^-extra parentheses--------------------------^
which is perhaps easier.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57
More information about the Gcc-bugs
mailing list