aboutsummaryrefslogtreecommitdiff
path: root/libphobos/src/std/windows
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2025-07-16 11:52:45 -0400
committerJason Merrill <jason@redhat.com>2025-07-22 17:34:56 -0400
commitfdbc5ff61b471076cc9c758fb6c30d62f7ef1c56 (patch)
tree6d1f08a4a2c0061fd515b78e9b5fdac612811c50 /libphobos/src/std/windows
parent9feecd152fd14a7ba1f4d60fbb988864f07f967e (diff)
downloadgcc-master.zip
gcc-master.tar.gz
gcc-master.tar.bz2
c++: constexpr union placement new [PR121068]HEADtrunkmaster
The note and example in [class.union] p6 think that placement new can be used to change the active member of a union, but we didn't support that for array members in constant-evaluation even after implementing P1330 and P2747. First I tried to address this by introducing a CLOBBER_BEGIN_OBJECT for the entire array, but that broke the resolution of LWG3436, which invokes 'new T[1]' for an array T, and trying to clobber a multidimensional array when the actual object is single-dimensional breaks. So I've raised that issue with the committee. Until that is resolved, this patch takes a simpler approach: allow initialization of an element of an array to make the array the active member of a union. PR c++/121068 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_store_expression): Allow ARRAY_REFs when activating an array member of a union. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/constexpr-union6.C: Expect x5 to work. * g++.dg/cpp26/constexpr-new4.C: New test.
Diffstat (limited to 'libphobos/src/std/windows')
0 files changed, 0 insertions, 0 deletions