public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102350] __builtin_source_location not available in earlier language modes Date: Thu, 16 Sep 2021 11:11:49 +0000 [thread overview] Message-ID: <bug-102350-4-S4e9dUjRGy@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-102350-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102350 --- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> --- You'd need a different builtin (so that you know the presence of the builtin means the new behavior), ideally tell the builtin some way the type it should construct objects in (as opposed to std::source_location::__impl), because otherwise you don't know how __builtin_source_location will behave (except for libstdc++ where for GCC we expect to support only the same GCC/libstdc++ combo). But more importantly, how would you use the builtin? I expect not using the builtin directly, so through a macro? Otherwise, if it is some inline function, you'd most likely get the location of the inline function and not that of the caller. That is part of the magic std::source_location::current behavior where exactly takes the location from for the builtin...
next prev parent reply other threads:[~2021-09-16 11:11 UTC|newest] Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-09-15 15:09 [Bug c++/102350] New: " pdimov at gmail dot com 2021-09-15 16:39 ` [Bug c++/102350] " jakub at gcc dot gnu.org 2021-09-15 17:37 ` pdimov at gmail dot com 2021-09-15 19:49 ` redi at gcc dot gnu.org 2021-09-15 21:12 ` pdimov at gmail dot com 2021-09-16 9:38 ` redi at gcc dot gnu.org 2021-09-16 9:50 ` jakub at gcc dot gnu.org 2021-09-16 10:13 ` pdimov at gmail dot com 2021-09-16 10:15 ` pdimov at gmail dot com 2021-09-16 10:19 ` jakub at gcc dot gnu.org 2021-09-16 10:24 ` pdimov at gmail dot com 2021-09-16 10:41 ` jakub at gcc dot gnu.org 2021-09-16 10:50 ` redi at gcc dot gnu.org 2021-09-16 10:53 ` redi at gcc dot gnu.org 2021-09-16 10:53 ` jakub at gcc dot gnu.org 2021-09-16 10:59 ` pdimov at gmail dot com 2021-09-16 11:02 ` pdimov at gmail dot com 2021-09-16 11:11 ` jakub at gcc dot gnu.org [this message] 2021-09-16 11:34 ` pdimov at gmail dot com 2021-09-16 11:54 ` redi at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-102350-4-S4e9dUjRGy@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).