https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101911
Bug ID: 101911
Summary: Type cannot be defined inside of the lambda in
unevaluated context
Product: gcc
Version: 11.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: eligorkadaf at gmail dot com
Target Milestone: ---
The following code is rejected by gcc:
#include <vector>
int main() {
std::vector<decltype([] {
struct { int x; } x;
return x; }()) > vec;
}
gcc claims that types cannot be defined inside of decltype. Hovewer, I did not
find anything in standard to confirm such a message in this context. So if you
need any proof, proof me please that there is a reason for gcc to claim that
first.
https://godbolt.org/z/8n6djencY