Created on 2025-09-13.00:00:00 last changed 1 month ago
Proposed resolution (approved by CWG 2025-11-04):
Change in 13.10.3.1 [temp.deduct.general] paragraph 9 as follows:
[ Example: ...
template <class T>
auto h(T) -> decltype([x = T::invalid]() { });
void h(...);
h(0); // error: invalid expression not part of the immediate context OK, calls h(...)
template <class T>
auto i(T) -> decltype([]() -> typename T::invalid { });
void i(...);
i(0); // error: invalid expression not part of the immediate context OK, calls i(...)
template <class T>
auto j(T t) -> decltype([](auto x) -> decltype(x.invalid) { } (t)); // #1
void j(...); // #2
j(0); // deduction fails on #1, OK, calls #2 j(...)
-- end example ]
(From submission #761.)
After issue 2672, the third and fourth comments in Example 7 in 13.10.3.1 [temp.deduct.general] paragraph 9 incorrectly treat the lambda-introducer and trailing return type of a lambda as if they were part of the lambda body.
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2025-11-07 07:33:50 | admin | set | status: tentatively ready -> ready |
| 2025-11-05 12:07:23 | admin | set | status: open -> tentatively ready |
| 2025-09-22 19:23:48 | admin | set | messages: + msg8113 |
| 2025-09-13 00:00:00 | admin | create | |