Skip to content

[dcl.type.decltype] What type does decltype of a splice specialization denote? #21

Description

@abhinavagarwal07

Subclause: [dcl.type.decltype]

P2996R13 specifies decltype(E) for an unparenthesized splice expression as the type of the entity, object, or value designated by the splice-specifier of E.

For a template splice-specialization-specifier, however, the contained splice-specifier designates the template, while [expr.prim.splice] forms the selected variable-template specialization S from that template and the template arguments.

For example:

template<class T> T value;

using R = decltype(template [:^^value:]<int>);

I would expect R to be int, the declared type of value<int>, but the current decltype bullet appears to ask for the type of the variable template value, which does not have a type. Is there another rule that makes this case well-defined?

If not, should [dcl.type.decltype] distinguish this form and use the type of the selected specialization S, following the construction already used in [expr.prim.splice] and [dcl.type.splice]?

The function-template forms are a separate question because they denote overload sets. They do not need to be resolved in order to clarify the variable-template case above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions