This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 116c. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-03-08
Consider:
template<typename _Tp> concept __is_derived_from_optional = requires (const _Tp& __t) { []<typename _Up>(const optional<_Up>&){ }(__t); };
According to 6.6 [basic.link] paragraph 15, the closure type of the lambda-expression is a TU-local entity, thus the concept is an exposure, thus it cannot appear in a module interface unit. There is no fundamental reason why this needs to be the case.
Suggested resolution:
Change in 6.6 [basic.link] paragraph 15.2 as follows:
An entity is TU-local if it is
- a type, function, variable, or template that
- has a name with internal linkage, or
- does not have a name with linkage and is declared, or introduced by a lambda-expression, within the definition of a TU-local entity,
- a type with no name that is defined outside a class-specifier, function body, concept-definition, or initializer or is introduced by a defining-type-specifier that is used to declare only TU-local entities,
- ...