diff options
author | Jakub Jelinek <jakub@redhat.com> | 2024-04-16 09:39:19 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@redhat.com> | 2024-04-16 09:39:19 +0200 |
commit | 79ff53453e88e40c4f2ecf6f7f7409afc41b46fc (patch) | |
tree | 224a5cc552c5c6a043356b0e718387bd59003cda /libgcc | |
parent | 6e925ba0a8b9619ed789a456b087755b488d66f1 (diff) | |
download | gcc-79ff53453e88e40c4f2ecf6f7f7409afc41b46fc.zip gcc-79ff53453e88e40c4f2ecf6f7f7409afc41b46fc.tar.gz gcc-79ff53453e88e40c4f2ecf6f7f7409afc41b46fc.tar.bz2 |
c++: Handle ARRAY_TYPE in check_bit_cast_type [PR114706]
https://eel.is/c++draft/bit.cast#3 says that std::bit_cast isn't constexpr
if To, From and the types of all subobjects have certain properties which the
check_bit_cast_type checks (such as it isn't a pointer, reference, union,
member pointer, volatile). The function doesn't cp_walk_tree though, so
I've missed one important case, for ARRAY_TYPEs we need to recurse on the
element type. I think we don't need to handle VECTOR_TYPEs/COMPLEX_TYPEs,
because those will not have a pointer/reference/union/member pointer in
the element type and if the element type is volatile, I think the whole
derived type is volatile as well.
2024-04-16 Jakub Jelinek <jakub@redhat.com>
PR c++/114706
* constexpr.cc (check_bit_cast_type): Handle ARRAY_TYPE.
* g++.dg/cpp2a/bit-cast17.C: New test.
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions