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

[expr.ass] does not specify the type of the expression (and traditionally misuses "result") #4864

Closed
languagelawyer opened this issue Sep 4, 2021 · 8 comments · Fixed by #4865
Assignees

Comments

@languagelawyer
Copy link
Contributor

No description provided.

@jensmaurer
Copy link
Member

I understand the first part ("type is not specified"), but could you please elaborate on the second part?

@languagelawyer
Copy link
Contributor Author

@jensmaurer
Copy link
Member

We seem to be not-quite-good with "result" throughout [expr], due to historical reasons.

@languagelawyer
Copy link
Contributor Author

Requests to fix such misuses are no (longer) accepted?

@jensmaurer
Copy link
Member

jensmaurer commented Sep 4, 2021

They are. A specific suggestion is appreciated.

@tkoeppe
Copy link
Contributor

tkoeppe commented Sep 9, 2021

Is the lack of type specification actually a problem, does it cause ambiguities? I'm not opposed to elaborating that, but I'd like to see a little more motivation.

@jensmaurer
Copy link
Member

jensmaurer commented Sep 9, 2021

@tkoeppe, every operator used to construct compound expressions should specify what type and value category the resulting compound expression has, and (when evaluated) what the value resulting from the operation is (plus any side effects etc.)

For assignment, we're lacking on the "type" part, which is simply a specification oversight / inconsistency. There's nothing ambiguous here.

For example, we say that 1+1 has type "int" (because the operands have type int, and (lots more mechanics)), but we don't say what the type of the compound expression "i = 1" is.

@tkoeppe
Copy link
Contributor

tkoeppe commented Sep 9, 2021

OK -- "omitted by oversight, inconsistent with other operator specifications" would be sufficient motivation. I'd welcome if that were part of the initial issue report.

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

Successfully merging a pull request may close this issue.

3 participants