]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Set active union member in constexpr std::string [PR103295]
authorNathaniel Shead <nathanieloshead@gmail.com>
Fri, 11 Nov 2022 11:23:31 +0000 (22:23 +1100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 14 Nov 2022 17:17:14 +0000 (17:17 +0000)
commita088d93c210f9b662d706e2fcf63a59d05fe27c1
tree2b2a1175bfb72b14d5585f18ba4a8801972a52ad
parent58da1386d2233b8e01aaac8f7c4a61a2ccf52743
libstdc++: Set active union member in constexpr std::string [PR103295]

Clang still complains about using std::string in constexpr contexts due
to the changes made in commit 98a0d72a. This patch ensures that we set
the active member of the union as according to [class.union.general] p6.

libstdc++-v3/ChangeLog:

PR libstdc++/103295
* include/bits/basic_string.h (_M_use_local_data): Set active
member to _M_local_buf.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
(cherry picked from commit 52672be7d328df50f9a05ce3ab44ebcae50fee1b)
libstdc++-v3/include/bits/basic_string.h