https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92752
--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-10 branch has been updated by Patrick Palka <ppa...@gcc.gnu.org>: https://gcc.gnu.org/g:8c12c47d0c5c40df6e5eeb8625d4708c8a42dbe0 commit r10-11483-g8c12c47d0c5c40df6e5eeb8625d4708c8a42dbe0 Author: Patrick Palka <ppa...@redhat.com> 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.c (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 <ja...@redhat.com> (cherry picked from commit e971990cbda091b4caf5e1a5bded5121068934e4)