Public bug reported:

How to reproduce:
=================

1. Install g++-5 with `sudo apt install g++-5`
2. Try compiling the following C++11 code:

cat << END > a.cpp
#include <iostream>
#include <string>
int main()
{ std::cout<<std::stoi("1234"); return 0; }
END
g++-5 -std=c++11 a.cpp

3. What happened: Fails with error:

a.cpp: In function ‘int main()’:
a.cpp:4:17: error: ‘stoi’ is not a member of ‘std’
    { std::cout<<std::stoi("1234"); return 0; }
                 ^

4. What is expected: No error.  Successful compilation.

Version information:
====================
lsb_release -rd
Description:    Ubuntu 17.10
Release:        17.10

g++-5 --version
g++-5 (Ubuntu 5.5.0-1ubuntu2) 5.4.1 20171010


Additional comments:
====================
I tested the same code in Ubuntu 16.04 with g++-5 (g++-5 (Ubuntu 
5.4.0-6ubuntu1~16.04.9) 5.4.0 20160609) and it compiles fine on it.

ProblemType: Bug
DistroRelease: Ubuntu 17.10
Package: g++-5 5.5.0-1ubuntu2
ProcVersionSignature: Ubuntu 4.13.0-32.35-generic 4.13.13
Uname: Linux 4.13.0-32-generic x86_64
ApportVersion: 2.20.7-0ubuntu3.7
Architecture: amd64
CurrentDesktop: ubuntu:GNOME
Date: Fri Feb 23 11:19:16 2018
EcryptfsInUse: Yes
InstallationDate: Installed on 2018-01-02 (51 days ago)
InstallationMedia: Ubuntu 17.10 "Artful Aardvark" - Release amd64 (20171018)
SourcePackage: gcc-5
UpgradeStatus: No upgrade log present (probably fresh install)

** Affects: gcc-5 (Ubuntu)
     Importance: Undecided
         Status: New


** Tags: artful

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

Title:
  g++-5 fails to compile c++11 code with -std=c++11 on Ubuntu 17.10

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

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to