Skip to content
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

[basic.def.odr] The set should be the potential results of E_2 #6697

Closed
ContingencyOfTautologicalContradictions opened this issue Nov 16, 2023 · 2 comments

Comments

@ContingencyOfTautologicalContradictions

https://eel.is/c++draft/basic.def.odr#3.3 mentions that the set of potential results of the form $E_1.\textcolor{cyan}{\textrm{template}}_{opt} E_2$ corresponds to $E_1$, the class instance being accessed, but that's untrue, the potential results correspond to $E_2$, the NSDM being accessed, hence change its wording to the following:

if $\textit{E}$ is a class member access expression ([expr.ref]) of the form $E_1$ . $\textcolor{cyan}{\textrm{template}}_{opt}$ $E_2$ naming a non-static data member, the set contains the potential results of $E_2$.

@ContingencyOfTautologicalContradictions ContingencyOfTautologicalContradictions changed the title [basic.def.odr] The set should be the potential result of $E_2$ [basic.def.odr] The set should be the potential result of E_2 Nov 16, 2023
@ContingencyOfTautologicalContradictions ContingencyOfTautologicalContradictions changed the title [basic.def.odr] The set should be the potential result of E_2 [basic.def.odr] The set should be the potential results of E_2 Nov 16, 2023
@ContingencyOfTautologicalContradictions
Copy link
Author

About why that's untrue: the result of the postfix expression is also ultimately determined by the id-expression after the dot as stated by expr.ref#1

@t3nsor
Copy link
Contributor

t3nsor commented Nov 27, 2023

Potential results of an expression E are certain id-expressions appearing in E whose values are required to be inlined when computing E, thus those id-expressions don't odr-use the variables they denote. In a non-static class member access expression, it is the left operand that would be odr-used if not inlined. The right operand merely identifies a particular subobject, which is irrelevant because subobjects can't be odr-used individually.

@jensmaurer jensmaurer closed this as not planned Won't fix, can't repro, duplicate, stale Nov 27, 2023
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

3 participants