public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97573] Implement C++20 [depr.arith.conv.enum] Date: Mon, 04 Oct 2021 16:34:46 +0000 [thread overview] Message-ID: <bug-97573-4-j7KMuPQ5YN@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-97573-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97573 --- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>: https://gcc.gnu.org/g:2dda00b734888d3b53ac91160083b5c6cd5ca5c8 commit r12-4148-g2dda00b734888d3b53ac91160083b5c6cd5ca5c8 Author: Marek Polacek <polacek@redhat.com> Date: Wed Sep 29 11:45:24 2021 -0400 c-family: Implement -Warray-compare [PR97573] 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 -Warray-compare. Since the code in question is dubious (the comparison doesn't actually compare the array elements), I've added this warning for C too, and enabled it in all C++ modes. PR c++/97573 gcc/c-family/ChangeLog: * c-common.h (do_warn_array_compare): Declare. * c-warn.c (do_warn_array_compare): New. * c.opt (Warray-compare): New option. gcc/c/ChangeLog: * c-typeck.c (parser_build_binary_op): Call do_warn_array_compare. gcc/cp/ChangeLog: * typeck.c (cp_build_binary_op): Call do_warn_array_compare. gcc/ChangeLog: * doc/invoke.texi: Document -Warray-compare. gcc/testsuite/ChangeLog: * c-c++-common/Warray-compare-1.c: New test. * c-c++-common/Warray-compare-2.c: New test.
next prev parent reply other threads:[~2021-10-04 16:34 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-25 20:17 [Bug c++/97573] New: " mpolacek at gcc dot gnu.org 2020-10-25 20:17 ` [Bug c++/97573] " mpolacek at gcc dot gnu.org 2020-10-25 20:25 ` mpolacek at gcc dot gnu.org 2020-10-28 21:44 ` cvs-commit at gcc dot gnu.org 2021-10-04 16:34 ` cvs-commit at gcc dot gnu.org [this message] 2021-10-04 16:35 ` mpolacek at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-97573-4-j7KMuPQ5YN@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).