From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B1C753858C74; Tue, 31 Oct 2023 14:17:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1C753858C74 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1698761830; bh=KTQFLnf0a7LpW7kFvQ25o0IjLJR+nNvv5diXugomQME=; h=From:To:Subject:Date:From; b=BesvxKoLytH8bUGUACOMJn4UgQZSYbmweFfwJ3y/2vy76YkK6MvW4TU8ruxrRin6t l5MvblgfNwikCdN/O0qX01Up8KRhVYoKjWYpBA8tBMHLHcRXZXV5zw/SXCD3JgIrGe bQGtWgc3UjwSUeaZSoXA4OlpBOibhhdl1zcXFEAc= From: "mccannd at uk dot ibm.com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/112315] New: 32-bit numeric conversion functions missing - only wstring versions defined Date: Tue, 31 Oct 2023 14:17:10 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.2.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mccannd at uk dot ibm.com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112315 Bug ID: 112315 Summary: 32-bit numeric conversion functions missing - only wstring versions defined Product: gcc Version: 13.2.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: mccannd at uk dot ibm.com Target Milestone: --- I created the following test program: =3D=3D=3D=3D #include int main(int argc, char* argv[]) { std::string X =3D "my string"; unsigned long long Y =3D std::stoull(X); } =3D=3D=3D=3D Using g++ 13.2.1, running the following fails: $ g++ -m32 cpptest.cpp cpptest.cpp: In function 'int main(int, char**)': cpptest.cpp:6:38: error: invalid initialization of reference of type 'const std::wstring&' {aka 'const std::__cxx11::basic_string&'} from expression of type 'std::string' {aka 'std::__cxx11::basic_string'} 6 | unsigned long long Y =3D std::stoull(X); | ^ In file included from /usr/include/c++/13/string:54, from cpptest.cpp:1: /usr/include/c++/13/bits/basic_string.h:4280:25: note: in passing argument = 1 of 'long long unsigned int std::__cxx11::stoull(const std::wstring&, std::size= _t*, int)' 4280 | stoull(const wstring& __str, size_t* __idx =3D 0, int __base =3D = 10) | ~~~~~~~~~~~~~~~^~~~~ This appears to be because _GLIBCXX11_USE_C99_STDLIB is no longer defined in /usr/include/c++/13/x86_64-redhat-linux/32/bits/c++config.h. The same compilation using g++ 13.0.1 works fine.=