https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120917

--- Comment #26 from Frank Heckenbach <f.heckenb...@fh-soft.de> ---
(In reply to Frank Heckenbach from comment #24)
> (In reply to Jason Merrill from comment #23)
> > 
> > Then yes, it does look like it should work; libstdc++ uses that 'requires
> > function call' pattern in
> > 
> >   template<typename _Tp>
> >     concept __is_derived_from_optional = requires (const _Tp& __t) {
> >       []<typename _Up>(const optional<_Up>&){ }(__t);
> >     };
> 
> Thanks, the lambda makes it a bit shorter, and the knowledge that libstdc++
> uses it gives me more confidence. So I'll try this:
> 
> template <typename T, template <typename ...> typename P> concept
> DerivedFromTemplate = requires (T v) { [] <typename ... U> (const P <U ...>
> &) { } (v); };

FYI, I applied this in my code, and apart from partial (T <auto, int>) and
nested (T <U <auto>>) cases, as expected, and a few cases that became ambiguous
(I assume because it has slightly different precedence in overload resolution
or so), it worked as I hoped it would.

After dealing with some new compiler warnings (some useful, some probably bogus
like https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116332#c3) and some issues in
libraries used, I could finally compile all my code with gcc-14 without <auto>.

So concerning https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120917#c15, I for
one won't need it with "-fpermissive" now. Thanks for all the help resolving
this matter.

Reply via email to