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
Confirmed.
*** Bug 102367 has been marked as a duplicate of this bug. ***
*** Bug 119072 has been marked as a duplicate of this bug. ***
*** Bug 122688 has been marked as a duplicate of this bug. ***