[Bug c++/57] [DR 325] GCC can't parse a non-parenthesized comma in a template-id within a default argument

igodard at pacbell dot net gcc-bugzilla@gcc.gnu.org
Fri Apr 30 02:54:00 GMT 2004


------- Additional Comments From igodard at pacbell dot net  2004-04-30 01:47 -------
There is at least one case where this construct is used in the standard (at least in the oldish references I have access to). In <bitset> there is (in the gcc 3.4 include files) the following function:
    template<class _CharT, class _Traits, class _Alloc>
      bitset(const basic_string<_CharT, _Traits, _Alloc>& __s,
         size_t __pos, size_t __n) : _Base()
However, according to the SGI documentation this should be:
template<class Char, class Traits, class Alloc>
explicit
bitset(const basic_string<Char,Traits,Alloc>& s,
       size_t pos = 0,
       size_t n = 
         basic_string<Char,Traits,Alloc>::npos)
which is also what C++PL 3rd Edition shows. The initializer "npos" causes gcc to fail with this bug.

FWIW

-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57



More information about the Gcc-bugs mailing list