https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115809
Bug ID: 115809 Summary: Gcc can't parse code where the decltype is written, which depends on the runtime arguments passed to the function. Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: linuxnyasha at tutanota dot com Target Milestone: --- template <int...> auto Foo() {}; auto Foo2(auto... is) { return Foo<is...>(); // works fine }; auto Foo3(auto... is) -> decltype(Foo<is...>()) {}; // error auto main() -> int { auto f = [](auto... is) -> decltype(Foo<is...>()){}; // error }; On clang everything works https://godbolt.org/z/vKqa9368d