public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/108035] New: std::source_location::function_name() provides an empty string when used with clang++
@ 2022-12-09 16:45 danhan at live dot ie
2022-12-09 18:31 ` [Bug libstdc++/108035] libstdc++ implementation of " jakub at gcc dot gnu.org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: danhan at live dot ie @ 2022-12-09 16:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108035
Bug ID: 108035
Summary: std::source_location::function_name() provides an
empty string when used with clang++
Product: gcc
Version: 12.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: danhan at live dot ie
Target Milestone: ---
I ran this minimal example from cppreference
https://en.cppreference.com/w/cpp/utility/source_location
on godbolt
https://godbolt.org/z/jYMYb8ez6
and source_location::function_name() returned an empty string where if the same
code is compiled with gcc it returns what appears to be the value of
__PRETTY_FUNCTION__ for the caller of the log(...) function,
as both have __PRETTY_FUNCTION__ as an internal I would have expected the
behavior to be the same.
Consequentally I have posted this on the llvm bugtracker as well :)
https://github.com/llvm/llvm-project/issues/59422
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/108035] libstdc++ implementation of std::source_location::function_name() provides an empty string when used with clang++
2022-12-09 16:45 [Bug libstdc++/108035] New: std::source_location::function_name() provides an empty string when used with clang++ danhan at live dot ie
@ 2022-12-09 18:31 ` jakub at gcc dot gnu.org
2022-12-09 18:52 ` redi at gcc dot gnu.org
2022-12-09 19:03 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-12-09 18:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108035
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That looks solely like a clang issue. It implements the builtin gcc has added
for <source_location> - __builtin_source_location () - but fills in
_M_function_name
with just "" rather than a pretty name.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/108035] libstdc++ implementation of std::source_location::function_name() provides an empty string when used with clang++
2022-12-09 16:45 [Bug libstdc++/108035] New: std::source_location::function_name() provides an empty string when used with clang++ danhan at live dot ie
2022-12-09 18:31 ` [Bug libstdc++/108035] libstdc++ implementation of " jakub at gcc dot gnu.org
@ 2022-12-09 18:52 ` redi at gcc dot gnu.org
2022-12-09 19:03 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2022-12-09 18:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108035
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Right, if Clang doesn't provide a name then there's nothing libstdc++ can do
about it.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libstdc++/108035] libstdc++ implementation of std::source_location::function_name() provides an empty string when used with clang++
2022-12-09 16:45 [Bug libstdc++/108035] New: std::source_location::function_name() provides an empty string when used with clang++ danhan at live dot ie
2022-12-09 18:31 ` [Bug libstdc++/108035] libstdc++ implementation of " jakub at gcc dot gnu.org
2022-12-09 18:52 ` redi at gcc dot gnu.org
@ 2022-12-09 19:03 ` pinskia at gcc dot gnu.org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-12-09 19:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108035
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
See Also| |https://github.com/llvm/llv
| |m-project/issues/59422
Resolution|--- |MOVED
Status|UNCONFIRMED |RESOLVED
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
As mentioned there is nothing GCC's libstdc++ can be done if clang/llvm's
__builtin_source_location implementation does not fill in the function name.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-12-09 19:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-09 16:45 [Bug libstdc++/108035] New: std::source_location::function_name() provides an empty string when used with clang++ danhan at live dot ie
2022-12-09 18:31 ` [Bug libstdc++/108035] libstdc++ implementation of " jakub at gcc dot gnu.org
2022-12-09 18:52 ` redi at gcc dot gnu.org
2022-12-09 19:03 ` 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).