https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110366
Bug ID: 110366
Summary: [C++26] P2641R4 Checking if a union alternative is
active
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: redi at gcc dot gnu.org
Blocks: 110339
Target Milestone: ---
https://wg21.link/p2641r4
This needs a new built-in. We can't use __builtin_constant_p(&x) because the
address of a union member is a constant even if that isn't the active member.
We can't use __builtin_constant_p(x) because not all types usable in constexpr
contexts are boolean testable.
Referenced Bugs:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110339
[Bug 110339] Implement C++26 library features