From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B1D68385843A; Fri, 28 Jan 2022 20:41:30 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B1D68385843A From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/92752] [9/10/11/12 Regression] Bogus "ignored qualifiers" warning on const-qualified pointer-to-member-function objects Date: Fri, 28 Jan 2022 20:41:30 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 9.2.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2022 20:41:30 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D92752 --- Comment #2 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:e971990cbda091b4caf5e1a5bded5121068934e4 commit r12-6926-ge971990cbda091b4caf5e1a5bded5121068934e4 Author: Patrick Palka Date: Fri Jan 28 15:41:15 2022 -0500 c++: bogus warning with value init of const pmf [PR92752] Here we're emitting a -Wignored-qualifiers warning for an intermediate compiler-generated cast of nullptr to 'method-type* const' as part of value initialization of a const pmf. This patch suppresses the warning by instead casting to the corresponding unqualified type. PR c++/92752 gcc/cp/ChangeLog: * typeck.cc (build_ptrmemfunc): Cast a nullptr constant to the unqualified pointer type not the qualified one. gcc/testsuite/ChangeLog: * g++.dg/warn/Wignored-qualifiers2.C: New test. Co-authored-by: Jason Merrill =