]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Allow exception classes to move fully-dynamic strings
authorJonathan Wakely <jwakely@redhat.com>
Thu, 2 Dec 2021 11:53:21 +0000 (11:53 +0000)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 2 Dec 2021 16:53:13 +0000 (16:53 +0000)
commitacf4fe96f12341da253fa9a932947581690122a4
tree6c2d5451325ac05788edbd12aaf06bf8b39e588f
parente2e98f524fdb80c16e3395f20fee930fbcad5562
libstdc++: Allow exception classes to move fully-dynamic strings

The move constructor for the fully-dynamic std::basic_string was not
noexcept until recently, so the std::logic_error and std::runtime_error
move constructors were defined to make non-throwing copies of their
string members, instead of potentially-throwing moves.

Now that move construction is always noexecpt, the exception classes can
always move the string. The fully-dynamic string move assignment was
always noexcept, so I don't know why I special-cased the move assignment
operators of the exception classes. That can be changed too.

libstdc++-v3/ChangeLog:

* src/c++11/cow-stdexcept.cc [_GLIBCXX_FULY_DYNAMIC_STRING]
(logic_error, runtime_error): Remove custom definitions.
libstdc++-v3/src/c++11/cow-stdexcept.cc