aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2023-06-24 05:15:02 -0400
committerJason Merrill <jason@redhat.com>2023-06-27 23:29:44 -0400
commita1c6e9631ca33990a2b7411060ca4d18db081a7d (patch)
tree91afe40e02b6179349c3e29a2d3ffb8a2e4c2d9c /gcc/expr.cc
parentdcd538933f8559b4ca9467da8eff3040f5af6166 (diff)
downloadgcc-a1c6e9631ca33990a2b7411060ca4d18db081a7d.zip
gcc-a1c6e9631ca33990a2b7411060ca4d18db081a7d.tar.gz
gcc-a1c6e9631ca33990a2b7411060ca4d18db081a7d.tar.bz2
c++: C++26 constexpr cast from void* [PR110344]
P2768 allows static_cast from void* to ob* in constant evaluation if the pointer does in fact point to an object of the appropriate type. cxx_fold_indirect_ref already does the work of finding such an object if it happens to be a subobject rather than the outermost object at that address, as in constexpr-voidptr2.C. P2768 PR c++/110344 gcc/c-family/ChangeLog: * c-cppbuiltin.cc (c_cpp_builtins): Update __cpp_constexpr. gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_constant_expression): In C++26, allow cast from void* to the type of a pointed-to object. gcc/testsuite/ChangeLog: * g++.dg/cpp26/constexpr-voidptr1.C: New test. * g++.dg/cpp26/constexpr-voidptr2.C: New test. * g++.dg/cpp26/feat-cxx26.C: New test.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions