From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9344A3947419; Tue, 15 Nov 2022 22:44:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9344A3947419 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1668552294; bh=7fD5nSvn+RQ7An3QtL57AjuPp7S9xjeJUP44wpH7k/g=; h=From:To:Subject:Date:In-Reply-To:References:From; b=VHjSmAMg4CG4MN9duN1o3fUKkyiib/s8SZWBLM3XZzAxdUgydYEf81ScL6kRIp4NQ apvv1UaJMRA6iMxrY+8+9bMvgTBEiXGGQeDjmbUUoTY766ahmqEIljUPwn5P/+SI28 wAjmjNJGHPuvfICNc1R3dNS81MZoJhmf4AsG+c80= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107492] Unhelpful -Wignored-qualifiers warning in template specialization Date: Tue, 15 Nov 2022 22:44:52 +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: 12.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: P3 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107492 --- Comment #5 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:ed1797ddf8285f59a50d9c883beb97705279d980 commit r13-4077-ged1797ddf8285f59a50d9c883beb97705279d980 Author: Marek Polacek Date: Tue Nov 1 11:49:03 2022 -0400 c++: Disable -Wignored-qualifiers for template args [PR107492] It seems wrong to issue a -Wignored-qualifiers warning for code like: static_assert(!is_same_v); because there the qualifier matters. Likewise in template specialization: template struct S { }; template<> struct S { }; template<> struct S { }; // OK, not a redefinition And likewise in other type-id contexts such as trailing-return-type: auto g() -> const void (*)(); This patch limits the warning to the function declaration context only. PR c++/107492 gcc/cp/ChangeLog: * decl.cc (grokdeclarator): Only emit a -Wignored-qualifiers warning when funcdecl_p. gcc/testsuite/ChangeLog: * g++.dg/warn/Wignored-qualifiers3.C: New test.=