cplusplus / cplusplus/draft

[temp.deduct.call] lacks the cross-reference to [temp.deduct.type] for describing deduction

Open
#5,550 0 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

In [temp.deduct.funcaddr] p1, [temp.deduct.conv] p1, [temp.deduct.partial] p8, and [temp.deduct.decl] p1, they all have a similar wording like:

The deduction is then done as described in [temp.deduct.type].

However, [temp.deduct.call] lacks wording like this. We want the following rules

If type deduction cannot be done for any P/A pair, or if for any pair the deduction leads to more than one possible set of deduced values, or if different pairs yield different deduced values, or if any template argument remains neither deduced nor explicitly specified, template argument deduction fails.

and

If a template parameter is used only in non-deduced contexts and is not explicitly specified, template argument deduction fails.

that are defined in [temp.deduct.type] apply to these cases

template<class T>
void fun(T,T){}

fun(0,0.f); // deduction fail

template<class T, class U>
void show(T, typename U::type){}

show(0,0); // deduction fail

Add the following rule in [temp.deduct.call] p4, by saying

The deduction is done as described in [temp.deduct.type].

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

Locate [temp.deduct.call] paragraph 4 in the draft source and compare its wording with the cited [temp.deduct.funcaddr], [temp.deduct.conv], [temp.deduct.partial], and [temp.deduct.decl] paragraphs. Done means the cross-reference to [temp.deduct.type] is added and the draft still renders successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.