[expr.call]/2 Unclear specification for virtual function calls P4176

Open Beginner friendly
#9,300 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
documentation

Research direction

Start at [expr.call]/2 in the C++ draft and compare its wording with P4176. Check how the paragraph handles ::x.foo() and the missing class member access condition; the work is done when both specification concerns are resolved, either by the paragraph or by adoption of P4176.

Written by the indexing model from the issue text.

Description

[expr.call]/2 says

If the selected function is non-virtual, or if the id-expression in the class member access expression is a qualified-id, that function is called. Otherwise, its final overrider in the dynamic type of the object expression is called; such a call is referred to as a virtual function call.

First, it should use "of" instead of "in". Consider ::x.foo().

Second, the "class member access expression" comes from nowhere, lacking a condition like "if the postfix-expression is a class member access expression".

Note that both would be resolved if P4176 is adopted.

Dominant language
TeX
Stars
221
Forks
813
Avg merge
17h 45m
Merged PRs (30d)
34

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cplusplus/draft

All issues in cplusplus/draft

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.