bloomberg/clang-p2996

Allow direct reflection of a dependent qualified-id having a splicer

Closed this issue · 1 comments

P2996 currently parses the following syntax as an expression:

constexpr auto R = ^[:S:]::inner;

whenever S is dependent on a template parameter. In the case where [:S:]::inner names a type, one could instead write:

constexpr auto R = ^typename [:S:]::inner;

but since P2996R2 removed the namespace [:R:] syntax, if [:S:]::inner names a nested namespace, then one instead must write:

using namespace Alias = [:S:];
constexpr auto R = ^Alias::inner;

Since it is known that the form ^[:S:]::inner will be parsed as an expression of type std::meta::info, it should be feasible to represent it as a reflection having kind e.g., RK_dependent_qualified_id, and to rebuild it as a reflection holding either a namespace, type, template, or expression during tree transform. It would be good to demonstrate the feasibility of this transformation with working code.

Not planning to adopt this for P2996, and therefore will not implement for the time being.