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++/103480] [10/11/12 Regression] -Werror=useless-cast with constexpr destructor Date: Wed, 12 Jan 2022 08:49:22 +0000 [thread overview] Message-ID: <bug-103480-4-XXck33PnWY@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103480-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103480 --- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:6bba184ccbf47368eaea27ee2c1e7b850526640b commit r12-6516-g6bba184ccbf47368eaea27ee2c1e7b850526640b Author: Jakub Jelinek <jakub@redhat.com> Date: Wed Jan 12 09:47:46 2022 +0100 c++: Silence -Wuseless-cast warnings during move [PR103480] This is maybe just a shot in the dark, but IMHO we shouldn't be diagnosing -Wuseless-cast on casts the compiler adds on its own when calling its move function. We don't seem to warn when user calls std::move either. We call move on elinit (*NON_LVALUE_EXPR <(struct C[2] &&) &D.2497->b>)[0] so it is already an xvalue_p and try to static_cast it to struct C &&. But we don't warn e.g. on std::move (std::move (whatever)). Fixed by not doing the static cast and just returning expr from move if expr is already an xvalue. 2022-01-11 Jakub Jelinek <jakub@redhat.com> Jason Merrill <jason@redhat.com> PR c++/103480 * tree.c (move): If expr is xvalue_p, just return expr without build_static_cast. * g++.dg/warn/Wuseless-cast2.C: New test.
next prev parent reply other threads:[~2022-01-12 8:49 UTC|newest] Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-29 22:51 [Bug c++/103480] New: [10,11,12]Werror=useless-cast " peeceseven at gmail dot com 2021-11-29 23:06 ` [Bug c++/103480] -Werror=useless-cast " mpolacek at gcc dot gnu.org 2021-11-30 0:11 ` mpolacek at gcc dot gnu.org 2021-11-30 0:46 ` [Bug c++/103480] [10/11/12 Regression] " mpolacek at gcc dot gnu.org 2021-11-30 0:52 ` mpolacek at gcc dot gnu.org 2021-12-30 17:49 ` jakub at gcc dot gnu.org 2022-01-12 8:49 ` cvs-commit at gcc dot gnu.org [this message] 2022-01-12 8:53 ` [Bug c++/103480] [10/11 " jakub at gcc dot gnu.org 2022-01-24 9:21 ` cvs-commit at gcc dot gnu.org 2022-01-24 9:28 ` [Bug c++/103480] [10 " jakub at gcc dot gnu.org 2022-05-10 8:22 ` cvs-commit at gcc dot gnu.org 2022-05-10 10:14 ` jakub 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-103480-4-XXck33PnWY@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).