cplusplus / cplusplus/draft

[stmt.expr] p1 There is not only a side effect but also value computation

Open
#5,183 11 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TeX
Stars
221
Forks
813
Avg merge
16h 4m
Merged PRs (30d)
36

Description

[stmt.expr] p1

The expression is a discarded-value expression. All side effects from an expression statement are completed before the next statement is executed. An expression statement with the expression missing is called a null statement.

Consider this example

int a = 0;
int main(){ 
   a; // #1
   if(true); // #2  
}

There is no side effect applying to a at #1. Also, the value computation of a(determine the identity of the object) should be completed before the execution of the statement at #2. We only mention the side effect in [stmt.expr] p1. Maybe, we should say that

The evaluation in an expression statement is completed before the next statement is executed.

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.

Research direction

Start by locating [stmt.expr] paragraph 1 in the draft source and review the surrounding wording on discarded-value expressions and side effects. Compare the proposed use of “evaluation” with the existing standard terminology; done means the text clearly covers both side effects and value computation without changing the intended semantics.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, tex
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.