https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65113
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |INVALID
Status|NEW |RESOLVED
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Since C++17 the effects of basic_string::copy are stated in terms of
traits_type::copy, and the precondition is inherited due to the use of
"Effects: Equivalent to ..." wording.
So at least since C++17, if passing the arguments to traits_type::copy is
invalid, then the call to basic_string::copy is invalid.
This was changed by LWG 2777 https://wg21.link/lwg2777
Since that's a library defect, I'm going to consider it correct for us to do it
before C++17 too.