cplusplus / cplusplus/draft

[expr.comma, class.base.init] What is "temporary expression"?

Open
#1,910 8 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

The phrase "temporary expression" does not seem to be a defined term. It is used in the following contexts:

[expr.comma]/1:

If the right operand is a temporary expression ([class.temporary]), the result is a temporary expression.

[class.base.init]/8:

A temporary expression bound to a reference member in a mem-initializer is ill-formed.

[class.base.init]/11:

A temporary expression bound to a reference member from a default member initializer is ill-formed.

The sentence in [expr.comma]/1 was added by CWG 462 and has editorial adjustments applied later. CWG 462 should probably be superseded by CWG 1299 and thus that sentence could be removed.

The ones in [class.base.init] could probably say "temporary object" rather than "temporary expression".

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 with the cited [expr.comma] and [class.base.init] paragraphs, then read CWG 462 and CWG 1299 to understand the terminology history. Resolve whether “temporary expression” is defined or should be replaced in each cited passage; done means the affected wording consistently uses an established term.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.