psmedley / gcc

GNU General Public License v2.0
7 stars 1 forks source link

C++11 support: std::stol, std::stoul, std::to_string and probably some other functions from C++11 are not declared. #14

Closed dbanet closed 8 years ago

dbanet commented 9 years ago

Expected behavior:

# uname
Linux
# cat <<EOF | g++ -std=c++11 -x c++ -
> #include <string>
> #include <iostream>
> using namespace std;
> main(){ string s="42";
> cout<<stol(s)<<endl; }
> EOF
# ./a.out
42

Present behavior:

# uname
OS/2
# cat <<EOF | g++ -std=c++11 -x c++ -
> #include <string>
> #include <iostream>
> using namespace std;
> main(){ string s="42";
> cout<<stol(s)<<endl; }
> EOF
<stdin>: In function 'int main()':
<stdin>:5:13: error: 'stol' was not declared in this scope
komh commented 8 years ago

Workaround: g++ -std=gnu++11 -x c++ -D_GLIBCXX_USE_C99

komh commented 8 years ago

I've fixed this problem in #23.

komh commented 8 years ago

Fixed by commit fef1630c35955e6352f9734b43d20758ce7508be.