Title
Inadequate value-dependence for reflect-expressions
Status
tentatively ready
Section
13.8.3.4 [temp.dep.constexpr]
Submitter
Dan Katz

Created on 2025-11-15.00:00:00 last changed 3 weeks ago

Messages

Date: 2025-11-21.20:43:46

Proposed resolution (approved by CWG 2025-11-21):

Change in 13.8.3.4 [temp.dep.constexpr] paragraph 7 as follows:

A reflect-expression is value-dependent if
  • it is of the form ^^reflection-name and either lookup for the reflection-name finds a declaration that inhabits a scope corresponding to a templated entity or the reflection-name is
    • is a dependent qualified name,
    • is a dependent namespace-name, or
    • is the name of a template parameter, or
    • names a dependent member of the current instantiation (13.8.3.2 [temp.dep.type]),
  • it is of the form ^^type-id and the type-id denotes a dependent type, or
  • it is of the form ^^id-expression and the id-expression is value-dependent.

(Drafting note: Reflection on block-scope externs is made ill-formed by issue 3065.)

Date: 2025-11-15.00:00:00

(From submission #808.)

The follow example ought to be value-dependent, but is currently not specified to be so:

  template <typename T>
  consteval void f() {
    T v;
    std::meta::info R = std::meta::type_of(^^v);   // not currently value-dependent
  }
History
Date User Action Args
2025-11-21 20:43:46adminsetstatus: open -> tentatively ready
2025-11-17 22:03:42adminsetmessages: + msg8387
2025-11-15 00:00:00admincreate