cplusplus / cplusplus/draft

[dcl.type.auto.deduct]/2.3 superfluous?

Open
#2,938 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

[dcl.type.auto.deduct]/2(.3) directly provides placeholder type deduction for a non-type template parameter.

A type T containing a placeholder type, and a corresponding initializer e, are determined as follows:

  • for a non-type template parameter declared with a type that contains a placeholder type, T is the declared type of the non-type template parameter and e is the corresponding template argument.

[temp.arg.nontype]/1 provides the same thing

If the type T of a template-parameter contains a placeholder type or a placeholder for a deduced class type, the type of the parameter is the type deduced for the variable x in the invented declaration T x =template-argument;

but by using [dcl.type.auto.deduct]/2.2

  • for a variable declared with a type that contains a placeholder type, T is the declared type of the variable and e is the initializer. …

With that, it doesn't seem like [dcl.type.auto.deduct]/2.3 is necessary. Besides, [dcl.type.class.deduct] does not directly provide for replacement of deduced class type placeholders in non-type template parameters, only in an initializing variable declaration.

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

Compare [dcl.type.auto.deduct]/2.3 with [temp.arg.nontype]/1 and [dcl.type.class.deduct], focusing on whether the cited rules already cover non-type template parameter deduction. Done means resolving whether the wording is redundant and documenting the needed standard-text change or rationale.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.