On Fri, Oct 01, 2021 at 09:30:41AM -0400, Jason Merrill wrote: > On 9/30/21 17:56, Marek Polacek wrote: > > On Thu, Sep 30, 2021 at 03:34:24PM -0400, Jason Merrill wrote: > > > On 9/30/21 10:50, Marek Polacek wrote: > > > > This patch addresses one of my leftovers from GCC 11. C++20 introduced > > > > [depr.array.comp]: > > > > "Equality and relational comparisons between two operands of array type > > > > are > > > > deprecated." > > > > so this patch adds -Wdeprecated-array-compare (enabled by default in > > > > C++20). > > > > > > Why not enable it by default in all modes? It was always pretty dubious > > > code. > > > > Sure, it could be done, but it kind of complicates things: we'd probably > > need a different option and a different message because it seems incorrect > > to say "deprecated" in e.g. C++17 when this was only deprecated in C++20. > > The warning could say "deprecated in C++20", which is always true? > > > I'd rather not add another option; if it stays -Wdeprecated-array-compare > > but -Wno-deprecated doesn't turn it off that also seems weird. > > > > I could rename it to -Warray-compare, enable by -Wall, and only > > append "is deprecated" to the warning message in C++20. Does that seem > > better? > > That sounds fine too.
I did this so that I can add the warning to the C FE too. Please take a look at <https://gcc.gnu.org/pipermail/gcc-patches/2021-October/580766.html> if you get the chance, thanks. So consider this patch discarded. I wonder what I could do so that Patchwork marks it as such, too. Marek