c++: Fix docs on assignment of virtual bases [PR60318]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 31 Aug 2021 08:46:41 +0000 (09:46 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 8 Sep 2021 21:34:16 +0000 (22:34 +0100)
commit3c64582372cf445eabc4f9e99def7e33fb0270ee
tree420f0cb5fd97ec25c47fa1354f7ae952116e5b41
parente66b9f6779f46433b0e2c093b58403604ed131cc
c++: Fix docs on assignment of virtual bases [PR60318]

The description of behaviour is incorrect, the virtual base gets
assigned before entering the bodies of A::operator= and B::operator=,
not after.

The example is also ill-formed (passing a string literal to char*) and
undefined (missing return from Base::operator=).

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
gcc/ChangeLog:

PR c++/60318
* doc/trouble.texi (Copy Assignment): Fix description of
behaviour and fix code in example.
gcc/doc/trouble.texi