On 4/27/25 15:57, Owen Avery wrote:
This patch should make it easier to selectively disable
-Wvirtual-move-assign errors by adding an attribute
for move assignment operators which marks them as handling
duplicate calls.
I'm only qualified to comment on the documentation part of the patch.
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 0978c4c41b2..39b3455909d 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -30412,6 +30412,19 @@ decltype(auto) foo(T&& t) @{
@};
@end smallexample
+@cindex @code{handles_virtual_move_assign} function attribute
+@item handles_virtual_move_assign
+
+If a C++ type has a default move assignment operator and virtually
+inherits from a base class with a non-trivial move assignment operator,
+the default move assignment operator may call the non-trivial assigment
s/assigment/assignment/
+operator multiple times. This causes gcc to emit a
s/gcc/GCC/
+@code{virtual-move-assign} warning, even if the non-trivial assignment
I don't think the manual names warnings like that or refers to them with
that kind of markup. I'd just say "emit a warning" here. Instead, you
need to mention and cross-reference @option{-Wvirtual-move-assign} (or
its negative form), and make corresponding changes to the docs for that
option to link here.
+operator is written to handle this. This attribute can be used on a
+base class' move assignment operator declaration to indicate that it
s/class'/class's/
+can handle the described situation, and that gcc should avoid emitting
s/gcc/GCC/
+a warning.
+
@cindex @code{warn_unused} type attribute
@item warn_unused
-Sandra