https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107532
--- Comment #23 from Marek Polacek <mpolacek at gcc dot gnu.org> --- (In reply to Kohei Takahashi from comment #21) > (In reply to Marek Polacek from comment #18) > > (In reply to Barnabás Pőcze from comment #17) > > > The simple test case with std::span still triggers the warning: > > > https://gcc.godbolt.org/z/43cKxdqr3. I feel that without deeper code > > > analysis such a warning will generate too many false positives and people > > > will simply turn it off. > > > > There really haven't been that many, except this and one with range-based > > for loops. > > I think it warns many usage of zip_iterator idiom such as boost.iterator and > P2321 style flat_map. Those uses tuple of references like std::tuple<T&...> > by dereferencing iterator, so that any algorithms may yield this warning. Ah, would you please have a testcase? If that's the case and the warning can't be taught to recognize that pattern, then I think we need to move it to -Wextra. Thanks.