This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/5843: An error in one of the g++ template files.
- From: rodrigc at gcc dot gnu dot org
- To: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, stanisls at ifi dot uio dot no
- Date: 6 Mar 2002 02:30:23 -0000
- Subject: Re: c++/5843: An error in one of the g++ template files.
- Reply-to: rodrigc at gcc dot gnu dot org, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, stanisls at ifi dot uio dot no, gcc-gnats at gcc dot gnu dot org
Synopsis: An error in one of the g++ template files.
State-Changed-From-To: open->feedback
State-Changed-By: rodrigc
State-Changed-When: Tue Mar 5 18:30:22 2002
State-Changed-Why:
The code is compiling because of:
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
rfind(const _CharT* __s, size_type __pos, size_type __n) const
{
size_type __size = this->size();
if (__n <= __size)
{
__pos = std::(((__size - __n) < (__pos)) ? (__size - __n) :
(__pos));
This code really should be:
template<typename _CharT, typename _Traits, typename _Alloc>
typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
rfind(const _CharT* __s, size_type __pos, size_type __n) const
{
size_type __size = this->size();
if (__n <= __size)
{
__pos = std::min(__size - __n ,__pos);
In the source code for your program, are you
defining a preprocessor min macro?
Can you undefine it, and see if that helps?
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=5843