[Bug 1739778] Re: G++ 5.4 does not compile some C++11 code without workaround flag

Launchpad Bug Tracker 1739778 at bugs.launchpad.net
Sat Feb 24 10:09:43 UTC 2018


Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: gcc-5 (Ubuntu)
       Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to gcc-5 in Ubuntu.
https://bugs.launchpad.net/bugs/1739778

Title:
  G++ 5.4 does not compile some C++11 code without workaround flag

Status in gcc-5 package in Ubuntu:
  Confirmed

Bug description:
  Simple C++ code example to trigger this error:
  #include <string>
  #include <iostream>

  int main()
  {
    std::cout << std::to_string(4) << std::endl;
    return 0;
  }

  Building with:
  g++-5 -std=c++11 main.cpp -o main

  will yield this error:
  main.cpp: In function 'int main()':
  main.cpp:6:16: error: 'to_string' is not a member of 'std'
     std::cout << std::to_string(4) << std::endl;
                  ^

  however when building with "D_GLIBCXX_USE_C99" flag it works:
  g++-5 -D_GLIBCXX_USE_C99 -std=c++11 main.cpp -o main

  I do not think it should be necessary to provide this flag, especially
  when G++ 5.4 does not need this flag on other distributions,
  std::to_string was introduced in C++11, so -std=c++11 should be
  enough.

  This was tested on Ubuntu 17.10

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1739778/+subscriptions



More information about the foundations-bugs mailing list