cplusplus / cplusplus/draft

[meta.reflection.queries] [dcl.fct] Disagreement about whether `int()const` is const qualified

Open
#9,239 4 comments 2 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 [dcl.fct] there exists the following note:

A function type that has a cv-qualifier-seq is not a cv-qualified type; there are no cv-qualified function types.

However, [meta.reflection.queries] has the following wording for std::meta::is_const and std::meta::is_volatile:

Returns: true if T represents a const or volatile type, respectively, or a const- or volatile-qualified function type, respectively. Otherwise, false.

The former states that there are no cv-qualified function types, while the latter is directly implying the possibility of cv-qualified function types (otherwise the second half of the first sentence would be redundant). It is quite clear what the latter is trying to state, that is_const(^^int()const) should be true. But if int()const really is a const qualified type, then std::is_const_v<int()const> should be true too which is obviously not intended.

Also, the subsequent definition of std::meta::is_lvalue_reference_qualified and std::meta::is_rvalue_reference_qualified contains:

Returns: true if T represents an lvalue- or rvalue-qualified function type, respectively. Otherwise, false.

The intent here is clear too but "lvalue-qualified" and "rvalue-qualified" do not get used anywhere else.

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 comparing the quoted wording in [dcl.fct] and [meta.reflection.queries], then search the draft for uses of “cv-qualified,” “lvalue-qualified,” and “rvalue-qualified.” Check how the wording relates to std::is_const_v<int()const>; done means the terminology and reflection-query intent are stated consistently without implying ordinary cv-qualified function types.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.