C++ Logo

std-discussion

Advanced search

unspecified defaulted move assignment with virtual bases

From: mauro russo <ing.russomauro_at_[hidden]>
Date: Tue, 7 Jul 2026 10:11:32 +0200
Following the message in
https://lists.isocpp.org/std-discussion/2026/07/3433.php

I really believe that the behavior from [class.copy.assign]-p(12.3) :
It is unspecified whether subobjects representing virtual base
classes are assigned more than once by the implicitly-defined
copy/move assignment operator

has room for modification proposals, related to the move assign.op.

Pls, anyone to clearly state it would not make sense to go
for a step further in https://isocpp.org/std/submit-a-proposal

I might propose to go for define as deleted the move assign.op.
as I don't see ways to work around it but not using at all.
Providing an unspecified definition that most likely "clears"
the objects state (moving twice or more), is totally unfair to me.
Other cases of unspecified have a workaround, as for example
the undetermined sequence in arguments evaluation for a
function call -> just don't rely on any in the rest of the code.
But here, I see nothing beyond just not using it.
If not an undefined behaviour, why not being consistent and
include in the rules to define as deleted ?
Other options are possible (to me) but not keep it 'unspecified'.

Kind regards.
Mauro.

Received on 2026-07-07 08:11:46