public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Wilhelm Meier <wilhelm.meier@hs-kl.de>
To: <gcc-help@gcc.gnu.org>
Subject: Unions, common-initial subsequence and UB
Date: Thu, 20 Oct 2022 13:46:52 +0200	[thread overview]
Message-ID: <8dc1aaa8-fe1b-e11b-b5e4-ae1acc30ff02@hs-kl.de> (raw)

Hi all,

this is more a general question instead of a g++ specific one:

the standard explicitly makes this exception: accessing an inactive 
union member is not UB if the members are structs with initial common 
sequence.

Is this also true in a constexpr context? I ask this because the chapter 
for constexpr expression does not mention this exception accessing an 
inactive memeber.

Thanks for hints,
  Wilhelm

             reply	other threads:[~2022-10-20 11:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-20 11:46 Wilhelm Meier [this message]
2022-10-20 13:10 ` Wilhelm Meier

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=8dc1aaa8-fe1b-e11b-b5e4-ae1acc30ff02@hs-kl.de \
    --to=wilhelm.meier@hs-kl.de \
    --cc=gcc-help@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).