public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/107712] New: std::format does not work for clang
@ 2022-11-16  0:45 unlvsur at live dot com
  2022-11-16 20:59 ` [Bug libstdc++/107712] " cvs-commit at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: unlvsur at live dot com @ 2022-11-16  0:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107712
           Summary: std::format does not work for clang
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: unlvsur at live dot com
  Target Milestone: ---

/home/cqwrteur/toolchains/native/native/include/c++/13.0.0/format:1030:12:
error: use of undeclared identifier '__builtin_toupper'; did you mean
'__builtin_launder'?
                  *__p = __builtin_toupper(*__p);
                         ^
/home/cqwrteur/toolchains/native/native/include/c++/13.0.0/new:194:14: note:
'__builtin_launder' declared here
    { return __builtin_launder(__p); }
             ^
In file included from concat_vs_format.cc:5:
/home/cqwrteur/toolchains/native/native/include/c++/13.0.0/format:1030:12:
error: non-pointer argument to '__builtin_launder' is not allowed
                  *__p = __builtin_toupper(*__p);
                         ^~~~~~~~~~~~~~~~~~~~~~~
/home/cqwrteur/toolchains/native/native/include/c++/13.0.0/format:2852:37:
error: no member named '__float128_t' in namespace 'std::__format'
            return type_identity<__format::__float128_t>();
                                 ~~~~~~~~~~^
3 errors generated.

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

* [Bug libstdc++/107712] std::format does not work for clang
  2022-11-16  0:45 [Bug libstdc++/107712] New: std::format does not work for clang unlvsur at live dot com
@ 2022-11-16 20:59 ` cvs-commit at gcc dot gnu.org
  2022-11-16 21:02 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-11-16 20:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:2f5c071860ba3f8ef67d0b9d8291a73766ce0a44

commit r13-4109-g2f5c071860ba3f8ef67d0b9d8291a73766ce0a44
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Nov 16 13:48:39 2022 +0000

    libstdc++: Adjust <format> for Clang compatibility [PR107712]

    Clang doesn't define __builtin_toupper, so use std::toupper.

    Also add some (not actually required since C++20) typename keywords to
    help Clang versions up to and including 15.

    libstdc++-v3/ChangeLog:

            PR libstdc++/107712
            * include/std/format (__format::__formatter_int::format): Use
            std::toupper when __builtin_toupper isn't available.
            (basic_format_arg::handle): Add 'typename'.
            * include/std/complex (complex<T>): Add 'typename'.

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

* [Bug libstdc++/107712] std::format does not work for clang
  2022-11-16  0:45 [Bug libstdc++/107712] New: std::format does not work for clang unlvsur at live dot com
  2022-11-16 20:59 ` [Bug libstdc++/107712] " cvs-commit at gcc dot gnu.org
@ 2022-11-16 21:02 ` redi at gcc dot gnu.org
  2022-11-16 22:15 ` unlvsur at live dot com
  2022-11-28 22:24 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2022-11-16 21:02 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Should be fixed now.

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

* [Bug libstdc++/107712] std::format does not work for clang
  2022-11-16  0:45 [Bug libstdc++/107712] New: std::format does not work for clang unlvsur at live dot com
  2022-11-16 20:59 ` [Bug libstdc++/107712] " cvs-commit at gcc dot gnu.org
  2022-11-16 21:02 ` redi at gcc dot gnu.org
@ 2022-11-16 22:15 ` unlvsur at live dot com
  2022-11-28 22:24 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: unlvsur at live dot com @ 2022-11-16 22:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from cqwrteur <unlvsur at live dot com> ---
(In reply to Jonathan Wakely from comment #2)
> Should be fixed now.

Question about toupper or any functions in ctype.h

These functions are not thread-safe and they do incur a very high cost due to
calling into shared libraries even for a very simple task. Plus it is undefined
behavior if the character value is above 127. They do not deal with
-fexec-charset correctly either.

Why not just write your own function which is simpler, faster, and more
versatile??

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

* [Bug libstdc++/107712] std::format does not work for clang
  2022-11-16  0:45 [Bug libstdc++/107712] New: std::format does not work for clang unlvsur at live dot com
                   ` (2 preceding siblings ...)
  2022-11-16 22:15 ` unlvsur at live dot com
@ 2022-11-28 22:24 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-11-28 22:24 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0

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

end of thread, other threads:[~2022-11-28 22:24 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-16  0:45 [Bug libstdc++/107712] New: std::format does not work for clang unlvsur at live dot com
2022-11-16 20:59 ` [Bug libstdc++/107712] " cvs-commit at gcc dot gnu.org
2022-11-16 21:02 ` redi at gcc dot gnu.org
2022-11-16 22:15 ` unlvsur at live dot com
2022-11-28 22:24 ` pinskia 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).