public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pdimov at gmail dot com" <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 10:24:33 +0000	[thread overview]
Message-ID: <bug-102350-4-HGe34PJGI6@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 #10 from Peter Dimov <pdimov at gmail dot com> ---
(In reply to Jakub Jelinek from comment #9)
> That would be an aliasing violation.
> The artificial vars created by __builtin_source_location have the
> std::source_location::__impl type, so accessing those using some other
> dynamic type is invalid.

In that case, the only valid way to use the result of __builtin_source_location
would just be std::source_location itself. :-/

I wonder whether there's a conformance problem in making it available. It's
true that the identifier `source_location` isn't reserved, but only programs
that include `<source_location>` can tell the difference, and these programs
(assuming they existed and worked) will probably be broken anyway because now
they'll be including the standard header instead of their own.

  parent reply	other threads:[~2021-09-16 10:24 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 [this message]
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
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-HGe34PJGI6@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: link
Be 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).