https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122688
Bug ID: 122688
Summary: Lambda returning a local type rejected in decltype
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: pdimov at gmail dot com
Target Milestone: ---
The following code:
using R = decltype([]{ struct X{}; return X{}; }());
is rejected by GCC with
error: types may not be defined in 'decltype' expressions
but it works under MSVC and Clang (in C++20 mode and above.)