cplusplus / cplusplus/draft

The requirement of the trailing requires-clause in function-definition

Open
#4,922 4 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

Since in p1971r0 where CA378 remove constrained non-template functions, the concrete rule is located in [dcl.decl.general] p4

The optional requires-clause ([temp.pre]) in an init-declarator or member-declarator shall be present only if the declarator declares a templated function ([dcl.fct]). When present after a declarator, the requires-clause is called the trailing requires-clause. The trailing requires-clause introduces the constraint-expression that results from interpreting its constraint-logical-or-expression as a constraint-expression.

However, it is just about requires-clause in an init-declarator or member-declarator. Whereas, function-definition is a distinct grammar that differs from them. How about the trailing requires-clause in a function-definition? Should it have had the same treatment with that in [dcl.decl.general] p4?

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

Read [dcl.decl.general] p4 alongside the function-definition grammar and the cited p1971r0 change. Determine whether the trailing requires-clause in a function-definition needs equivalent wording, then resolve the standards question and update the draft wording if required.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
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.