RFR: 8263134: HotSpot Style Guide should disallow inheriting constructors
David Holmes
dholmes at openjdk.java.net
Mon Mar 7 00:33:00 UTC 2022
On Fri, 4 Mar 2022 15:04:47 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
> Please review this change to explicitly disallow the use of inheriting
> constructors:
> (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm).
>
> The C++11/14 specification has a lot of problems. These were addressed in
> C++17 (and as a DR that affects C++11/14):
> (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/p0136r1.html).
>
> Use of inheriting constructors now runs the risk of encountering those bugs,
> inconsistent behavior between different compilers or compiler versions, and
> behavior changes for future support of C++17.
>
> This is a modification of the Style Guide, so rough consensus among the
> HotSpot Group members is required to make this change. Only Group members
> should vote for approval (via the github PR), though reasoned objections or
> comments from anyone will be considered. A decision on this proposal will not
> be made before Friday 18-Mar-2022 at 12h00 UTC.
>
> Since we're piggybacking on github PRs here, please use the PR review process
> to approve (click on Review Changes > Approve), rather than sending a "vote:
> yes" email reply that would be normal for a CFV.
This seems reasonable as it is no real hardship to explicitly declare all constructors. Personally I think it is clearer as well otherwise you have to go and lookup the base class to see what the constructor semantics are.
Thanks.
-------------
Marked as reviewed by dholmes (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/7698
More information about the hotspot-dev
mailing list