Skip to content

Conversation

sdkrystian
Copy link
Contributor

This is an attempt to make our definition of "override" and "final overrider" more consistent with its use, and includes some small cleanups along the way.

In [class.cdtor] p4 we have the following wording:

[...] the function called is the final overrider in the constructor's or destructor's class [...]

We also have the following wording in [expr.call] p3:

Otherwise, its final overrider in the dynamic type of the object expression is called

In both of these cases, we refer to the final overrider relative to another class. Changing the definition to match the use here seems reasonable. The approach taken here is to define the final overrider of a function relative to a class (as far as I can tell this wording shouldn't change semantics; it accounts for redeclared members not being members of the derived class).

There also was a missing \grammarterms around ref-qualifier, and cv-qualification was changed to be cv-qualifier-seq to match function declarators. Since we no longer need to consider virtual functions to override themselves, it allows us to simplify the wording a bit in other places.

@AlisdairM
Copy link
Contributor

This looks like a nice cleanup, but has no feedback. Would we be interested in seeing a rebase to land for C++26 FDIS?

@@ -3748,7 +3748,7 @@

\pnum
A non-static member function is a \defnadj{virtual}{function}
if it is first declared with the keyword \tcode{virtual} or
if it is declared with the keyword \tcode{virtual} or
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the "first" wants to say that adding "virtual" on the out-of-class definition does nothing.

@jensmaurer jensmaurer added the cwg Issue must be reviewed by CWG. label Aug 24, 2025
@jensmaurer
Copy link
Member

This is more than moving words around and thus needs CWG review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cwg Issue must be reviewed by CWG. needs rebase The pull request needs a git rebase to resolve merge conflicts.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants