RFR: 8258010: Debug build failure with clang-10 due to -Wdeprecated-copy and -Wimplicit-int-float-conversion
Kim Barrett
kim.barrett at oracle.com
Sat Jan 2 18:30:29 UTC 2021
> On Dec 24, 2020, at 3:44 PM, Xin Liu <xliu at openjdk.java.net> wrote:
>
> On Thu, 24 Dec 2020 17:27:39 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> […]
>> Since DUIterator_Last is just delegating both the copy constructor and
>> assignment operator to the base class, their copy constructor and
>> assignment operator would be better as the default (either implicit or
>> explicit using `=default`) rather than explicit code.
>
> Agree. c2 actually never uses the assignment operator of DUIterator_Last. It needs the copy constructor in this line.
> https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/node.hpp#L1499
>
> you can delete the following code or leave it =default.
> - void operator=(const DUIterator_Last& that)
> - { DUIterator_Fast::operator=(that); }
DUIterator_Last::operator= *is* used, for example:
https://github.com/openjdk/jdk/blob/master/src/hotspot/share/opto/node.hpp#L1473
That doesn't change whether defaulting DUIIterator_Last's copy constructor
and copy assign works though (whether implicit or explicit). So making it
implicit does work.
I think making it explicitly defaulted might be better though, to make it
clear the default behavior is intentional and it wasn't accidentally left as
the implicit default. This is because the default isn't right for the other
related classes.
More information about the build-dev
mailing list