[Bug c++/64422] New: basic_string::erase is unresloved

bernd.edlinger at hotmail dot de gcc-bugzilla@gcc.gnu.org
Sun Dec 28 05:37:00 GMT 2014


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64422

            Bug ID: 64422
           Summary: basic_string::erase is unresloved
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bernd.edlinger at hotmail dot de

starting with around r218964, "New std::string implementation."
the following program does no longer link correctly:

cat test1.cc 
#include <string>

int
main()
{
  std::string x;
  x.erase(x.begin(), x.end());
}


g++ test1.cc
/tmp/ccgup1FU.o: In function `main':
test1.cc:(.text+0x41): undefined reference to `std::__cxx11::basic_string<char,
std::char_traits<char>,
std::allocator<char>>::erase(__gnu_cxx::__normal_iterator<char*,
std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char>>>, __gnu_cxx::__normal_iterator<char*,
std::__cxx11::basic_string<char, std::char_traits<char>,
std::allocator<char>>>)'
collect2: error: ld returned 1 exit status


This does however not happen at -O1 and above.
Or if -std=gnu++11 is used.



More information about the Gcc-bugs mailing list