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


2988. Is a closure type from a lambda-expression appearing in a concept-definition a TU-local entity?

Section: 6.6  [basic.link]     Status: open     Submitter: Jason Merrill     Date: 2025-01-24

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