https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110681
Bug ID: 110681 Summary: bogus warning -Wreturn-type for lambda in tparam list Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: eric.niebler at gmail dot com Target Milestone: --- The following valid C++20 code causes gcc trunk to erroneously warn about a missing return statement. template <auto X = []{}> constexpr auto y = X; template <class T> using C = decltype(y<>); using D = C<int>; <source>: In substitution of 'template<class T> using C = decltype (y<<lambda> >) [with T = int]': <source>:27:18: required from here <source>:21:22: warning: no return statement in function returning non-void [-Wreturn-type] 21 | template <auto X = []{}> | ^~~~ Compiler returned: 0