Skip to content

[basic.def.odr] Avoid double-negation when defining whether a function is named by an expression #7900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zygoloid opened this issue May 29, 2025 · 0 comments

Comments

@zygoloid
Copy link
Member

[basic.def.odr]/4.1 is currently relatively hard to parse due to the double-negation "unless [....] is not":

A function is named by an expression or conversion if it is the selected member of an overload set ([basic.lookup], [over.match], [over.over]) in an overload resolution performed as part of forming that expression or conversion, unless it is a pure virtual function and either the expression is not an id-expression naming the function with an explicitly qualified name or the expression forms a pointer to member ([expr.unary.op]).

Perhaps it could be rephrased to avoid this:

A function is named by an expression or conversion if it is the selected member of an overload set ([basic.lookup], [over.match], [over.over]) in an overload resolution performed as part of forming that expression or conversion, and either unless it is not a pure virtual function or and either the expression is not an id-expression naming the function with an explicitly qualified name or that does not form the expression forms a pointer to member ([expr.unary.op]).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant