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

            Bug ID: 83101
           Summary: stod, stold was not declared
           Product: gcc
           Version: 5.4.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nicolas.gama at gmail dot com
  Target Milestone: ---

in the g++-5 package in ubuntu artful (g++-5 (Ubuntu 5.5.0-1ubuntu1) 5.4.1
20171010)

the c++11 functions stod, stold are unavailable

(it seems that the macro _GLIBCXX_USE_C99 is not defined by the -std=c++11 or
-std=gnu++11 flag)

minimal example: a.cpp
-----------
#include <iostream>   // std::cout
#include <string>     // std::string, std::stod

int main ()
{
  std::string orbits ("90613.305");
  double pluto = std::stod (orbits);
  return 0;
}
----------

g++-5 -std=c++11 a.cpp
-> a.cpp: In function 'int main()':
a.cpp:7:18: error: 'stod' is not a member of 'std'
   double pluto = std::stod (orbits);

The problem does not appear with g++-6, g++-7.

Reply via email to