public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/112315] New: 32-bit numeric conversion functions missing - only wstring versions defined
@ 2023-10-31 14:17 mccannd at uk dot ibm.com
  2023-10-31 15:20 ` [Bug c++/112315] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: mccannd at uk dot ibm.com @ 2023-10-31 14:17 UTC (permalink / raw)
  To: gcc-bugs

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

            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:

====
#include <string>

int main(int argc, char* argv[])
{
  std::string X = "my string";
  unsigned long long Y = std::stoull(X);
}
====

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<wchar_t>&'} from
expression of type 'std::string' {aka 'std::__cxx11::basic_string<char>'}
    6 |   unsigned long long Y = 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 = 0, int __base = 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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/112315] 32-bit numeric conversion functions missing - only wstring versions defined
  2023-10-31 14:17 [Bug c++/112315] New: 32-bit numeric conversion functions missing - only wstring versions defined mccannd at uk dot ibm.com
@ 2023-10-31 15:20 ` redi at gcc dot gnu.org
  2023-10-31 15:35 ` mccannd at uk dot ibm.com
  2023-10-31 15:43 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2023-10-31 15:20 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://bugzilla.redhat.com
                   |                            |/show_bug.cgi?id=2246731

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
I think this is a Fedora packaging problem:
https://bugzilla.redhat.com/show_bug.cgi?id=2246731

My builds of upstream GCC 13 work correctly.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/112315] 32-bit numeric conversion functions missing - only wstring versions defined
  2023-10-31 14:17 [Bug c++/112315] New: 32-bit numeric conversion functions missing - only wstring versions defined mccannd at uk dot ibm.com
  2023-10-31 15:20 ` [Bug c++/112315] " redi at gcc dot gnu.org
@ 2023-10-31 15:35 ` mccannd at uk dot ibm.com
  2023-10-31 15:43 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mccannd at uk dot ibm.com @ 2023-10-31 15:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from mccannd at uk dot ibm.com ---
OK, thanks. I had just started using Fedora 39. I assume this bug can be closed
then.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/112315] 32-bit numeric conversion functions missing - only wstring versions defined
  2023-10-31 14:17 [Bug c++/112315] New: 32-bit numeric conversion functions missing - only wstring versions defined mccannd at uk dot ibm.com
  2023-10-31 15:20 ` [Bug c++/112315] " redi at gcc dot gnu.org
  2023-10-31 15:35 ` mccannd at uk dot ibm.com
@ 2023-10-31 15:43 ` redi at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2023-10-31 15:43 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |MOVED

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Let's close as MOVED.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-31 15:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-31 14:17 [Bug c++/112315] New: 32-bit numeric conversion functions missing - only wstring versions defined mccannd at uk dot ibm.com
2023-10-31 15:20 ` [Bug c++/112315] " redi at gcc dot gnu.org
2023-10-31 15:35 ` mccannd at uk dot ibm.com
2023-10-31 15:43 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).