This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of New status.

4576. {can_}substitute specification is (still) ill-formed

Section: 21.4.13 [meta.reflection.substitute] Status: New Submitter: S. B. Tam Opened: 2026-05-05 Last modified: 2026-05-09

Priority: Not Prioritized

View all other issues in [meta.reflection.substitute].

View all issues with New status.

Discussion:

The use of template [: x :] (introduced in LWG 4316(i)) is incorrect: template [: x :] is a splice-expression (which can only designate a function template or variable template), and an unparenthesized splice-expression is not allowed as a template-argument per 13.3 [temp.names]/6.

Proposed resolution:

This wording is relative to N5032.

  1. Modify 21.4.13 [meta.reflection.substitute] as indicated:

    -1- Let TARG-SPLICE(x) be:

    1. (1.1) — template [: x :]a template-argument that denotes what x represents if is_template(x) is true, otherwise

    2. (1.2) — typename [: x :] if is_type(x) is true, otherwise

    3. (1.3) — ([: x :]).