public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "redi at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107797] New: "warning right operand of comma operator has no effect" for expressions with no comma operator Date: Mon, 21 Nov 2022 17:41:15 +0000 [thread overview] Message-ID: <bug-107797-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107797 Bug ID: 107797 Summary: "warning right operand of comma operator has no effect" for expressions with no comma operator Product: gcc Version: 13.0 Status: UNCONFIRMED Keywords: diagnostic Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: redi at gcc dot gnu.org Target Milestone: --- int main() { (long)new int{}; long(new int{}); } With -Wall this gives: comma.cc: In function ‘int main()’: comma.cc:2:20: warning: right operand of comma operator has no effect [-Wunused-value] 2 | (long)new int{}; | ^ comma.cc:3:20: warning: right operand of comma operator has no effect [-Wunused-value] 3 | long(new int{}); | ^ There is no comma operator in the code. The bogus warning has been there since at least 6.1
next reply other threads:[~2022-11-21 17:41 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2022-11-21 17:41 redi at gcc dot gnu.org [this message] 2022-11-21 17:59 ` [Bug c++/107797] " mpolacek at gcc dot gnu.org 2022-11-21 18:03 ` pinskia at gcc dot gnu.org 2022-11-21 18:12 ` mpolacek at gcc dot gnu.org 2022-11-21 18:19 ` pinskia at gcc dot gnu.org 2023-01-19 19:03 ` mpolacek at gcc dot gnu.org 2023-01-23 21:42 ` cvs-commit at gcc dot gnu.org 2023-01-23 21:42 ` mpolacek at gcc dot gnu.org 2023-01-23 21:43 ` pinskia 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-107797-4@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).