cplusplus / cplusplus/draft

Cleanups after CWG2672

Open
#6,718 5 comments 1 reaction 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

A couple of editorial cleanups would seem nice post-CWG2672:

  1. In the writeup of CWG2672, I suggested: "[...] move the rule somewhere more general", which has not happened. The general rule that substitution into a lambda-expression considers the body to not be in the immediate context, which applies to all substitutions, is still in [temp.deduct.general], the section on template argument deduction.

  2. The example in [temp.deduct.general]/9, immediately after the normative wording changed by that issue, doesn't match the rule. Prior to CWG2672, the rule was that all substitution into a lambda-expression during template argument deduction was not in the immediate context, and afterwards, the rule is that only substitution into the body is in the immediate context (but it doesn't matter if we're doing template argument deduction or something else). In particular, the h example is now valid:

template <class T>
  auto h(T) -> decltype([x = T::invalid]() { });
void h(...);
h(0);               // error: invalid expression not part of the immediate context

... should presumably say something like OK; invalid expression is in the immediate context.

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 [temp.deduct.general] in the C++ draft source and review the wording changed by CWG2672. Update the general rule placement or wording as appropriate, and revise the h example so its result matches the post-CWG2672 rule. Done means the normative text and example are consistent.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, tex
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.