cplusplus / cplusplus/draft

[dcl.type.general] p3 The grammar type-specifier-seq does not comprise defining-type-specifier

Open
#5,540 1 comment 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

[dcl.type.general] p3 says

Except in a declaration of a constructor, destructor, or conversion function, at least one defining-type-specifier that is not a cv-qualifier shall appear in a complete type-specifier-seq or a complete decl-specifier-seq.

The grammar type-specifier-seq is the sequence of type-specifier, which can never include a defining-type-specifier. A defining-type-specifier can be a type-specifer but not the way around; that is, defining-type-specifier is a wider component than type-specifer. As specified in https://stackoverflow.com/questions/62506440/why-a-conversion-function-declaration-does-not-require-at-least-one-defining-typ

The suggested resolution might be

Except the decl-specifier-seq in a declaration of a constructor, destructor, or conversion function, a complete decl-specifier-seq shall contain at least one defining-type-specifier that is not a cv-qualifier, and a complete type-specifier-seq shall contain at least one type-specifier that is not a cv-qualifier.

As a drive-by, the exception should only apply to the decl-specifier-seq of the conversion function, since the type-specifier-seq in its conversion-type-id should obey the rule; comprise at least a type-specifier that is not a cv-qualifier.

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 [dcl.type.general] paragraph 3 and the grammar definitions for type-specifier-seq, decl-specifier-seq, defining-type-specifier, and conversion-type-id. Compare the current rule with the suggested resolution and verify that the constructor, destructor, and conversion-function exceptions apply to the intended sequences. Done means the wording is grammatically consistent and reflects the intended constraint.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.