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

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Petr Vaněk from comment #0)
> The issue appears to arise from internal changes in libstdc++ that now
> require the explicit inclusion of the <algorithm> header (this part is
> likely a bug within rspamd).

The C++ standard always required the explicit inclusion of <algorithm> for the
std::remove algorithm. This is definitely a bug in rspamd.

> Is it possible to enhance the error messaging,
> perhaps with a fix-it hint, to suggest that <algorithm> needs to be
> explicitly included for clarity?

That would be difficult, because std::remove is overloaded and another overload
was found here (the one declared in <cstdio>). Usually we only provide fix-it
hints when name lookup doesn't find anything.

> Here is the minimized snippet to reproduce the issue:
> 
> #include <functional>
> #include <stdexcept>
> struct test;
> std::vector<test *> v;
> auto f(test *t) {
>   auto it = std::remove(begin(v), end(v), t);
> }

This is broken in two ways, you need to include both <algorithm> *and* <vector>
for this program.

Reply via email to