aboutsummaryrefslogtreecommitdiff
path: root/libphobos/src/std/logger
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2025-08-05 15:16:50 -0700
committerJason Merrill <jason@redhat.com>2025-08-05 15:16:50 -0700
commitbc42128330c0ea70a015b74b655cb8c48b6a8c06 (patch)
treec5ee772142fc6e45ae5f9fced7f177ea032de341 /libphobos/src/std/logger
parent14ca0646962f291d1b13497b35061020a97305b4 (diff)
downloadgcc-master.zip
gcc-master.tar.gz
gcc-master.tar.bz2
c++: clobber object on placement new [PR121068]HEADtrunkmaster
My r16-2432 patch addressed the original testcase involving an array of scalars, but not this additional testcase involving an array of classes. This patch addresses the issue more thoroughly, by having placement new first clobber the new object, and improving cxx_eval_store_expression to implement initial clobbers as well. My earlier attempt to do this clobbered the array as a whole, which broke construct_at after the resolution of LWG3436 due to trying to create a multidimensional array over the top of a single-dimensional array. To side-step that issue, this patch instead clobbers the individual elements of an array, taking advantage of the earlier change to let that activate the array member of a union. PR c++/121068 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_store_expression): Handle clobbers. (potential_constant_expression_1): Handle clobbers more. * decl.cc (build_clobber_this): Use INIT_EXPR for initial clobber. * init.cc (build_new_1): Clobber on placement new. (build_vec_init): Don't clean up after clobber. gcc/testsuite/ChangeLog: * g++.dg/cpp26/constexpr-new5.C: New test.
Diffstat (limited to 'libphobos/src/std/logger')
0 files changed, 0 insertions, 0 deletions