https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126149
Bug ID: 126149
Summary: GCC rejects valid program with auto used in decltype
Product: gcc
Version: 17.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jlame646 at gmail dot com
Target Milestone: ---
The following valid program is rejected by all three compilers(including gcc):
```
struct NoMove {
NoMove(NoMove&&) = delete;
};
NoMove&& DeclVal();
void F1(...);
void F2(auto);
using Type1 = decltype(F1(DeclVal())); // #1: this compiles
using Type2 = decltype(F2(DeclVal())); // #2: this doesn't compile when it
should
```