aboutsummaryrefslogtreecommitdiff
path: root/libcpp/lex.c
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-11-17 10:23:14 +0000
committerJonathan Wakely <jwakely@redhat.com>2021-11-17 17:21:25 +0000
commit6afa1083c6ee7b31629fb0c16299b952cb17868c (patch)
tree80ca1827605ce99fa1690f650cb3f707e857a363 /libcpp/lex.c
parent054bf99841aad3869c70643b2ba2d9f85770c980 (diff)
downloadgcc-6afa1083c6ee7b31629fb0c16299b952cb17868c.zip
gcc-6afa1083c6ee7b31629fb0c16299b952cb17868c.tar.gz
gcc-6afa1083c6ee7b31629fb0c16299b952cb17868c.tar.bz2
libstdc++: Set active member of union in std::string [PR103295]
Clang diagnoses that the new constexpr std::string constructors are not usable in constant expressions, because they start to write to members of the union without setting an active member. This adds a new helper function which returns the address of the local buffer after making it the active member. This doesn't fix all problems with Clang, because it still refuses to write to memory returned by the allocator. libstdc++-v3/ChangeLog: PR libstdc++/103295 * include/bits/basic_string.h (_M_use_local_data()): New member function to make local buffer the active member. (assign(const basic_string&)): Use it. * include/bits/basic_string.tcc (_M_construct, reserve()): Likewise.
Diffstat (limited to 'libcpp/lex.c')
0 files changed, 0 insertions, 0 deletions