https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115808
--- Comment #10 from Jonathan Wakely <redi at gcc dot gnu.org> ---
EDG rejects it too:
"loop.cc", line 11: warning: "auto Magic(utempl::loopholes::Getter<I>)"
declares a non-template function -- add <> to refer to a template
instance
friend constexpr auto Magic(Getter<I>);
^
"loop.cc", line 31: error: no instance of function template "Injector::Method"
matches the argument list
argument types are: (int)
object type is: const Injector
arg.Method(42);
^
detected during:
instantiation of "SomeStruct::SomeStruct(auto &&) [with
<auto-1>=const Injector &]" at line 43
instantiation of "auto Use<T,Args...>() [with T=SomeStruct,
Args=<Injector{}>]" at line 53
"loop.cc", line 54: error: cannot deduce the return type of function
"utempl::loopholes::Magic" (declared at line 11); it has not been
defined
static_assert(is_same_v<decltype(Magic(utempl::loopholes::Getter<0>{})),
^
"loop.cc", line 54: error: static assertion failed
static_assert(is_same_v<decltype(Magic(utempl::loopholes::Getter<0>{})),
^
3 errors detected in the compilation of "loop.cc".