Jonathan Wakely b272bc0fbf libstdc++: Fix self-move for std::weak_ptr [PR108118]
I think an alternative fix would be something like:

  _M_ptr = std::exchange(rhs._M_ptr, nullptr);
  _M_refcount = std::move(rhs._M_refcount);

The standard's move-and-swap implementation generates smaller code at
all levels except -O0 and -Og, so it seems simplest to just do what the
standard says.

libstdc++-v3/ChangeLog:

	PR libstdc++/108118
	* include/bits/shared_ptr_base.h (weak_ptr::operator=):
	Implement as move-and-swap exactly as specified in the standard.
	* testsuite/20_util/weak_ptr/cons/self_move.cc: New test.

(cherry picked from commit 92eb0adc14)
2023-06-23 13:45:43 +01:00
2023-05-22 00:18:45 +00:00
2023-06-23 00:18:33 +00:00
2023-03-04 00:18:05 +00:00
2022-08-03 00:17:42 +00:00
2023-05-22 00:18:45 +00:00
2023-05-04 00:19:22 +00:00
2023-05-04 00:19:22 +00:00
2022-12-14 00:20:21 +00:00
2023-05-04 00:19:22 +00:00
2023-05-22 00:18:45 +00:00
2020-01-15 14:29:53 +01:00
2020-11-25 09:00:08 +01:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 1.5 GiB
Languages
C++ 30.7%
C 30%
Ada 14.5%
D 6.1%
Go 5.7%
Other 12.5%