c++/5843: An error in one of the g++ template files.

rodrigc@gcc.gnu.org rodrigc@gcc.gnu.org
Tue Mar 5 18:30:00 GMT 2002


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



More information about the Gcc-prs mailing list