From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id CF2513858434; Fri, 15 Oct 2021 21:00:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CF2513858434 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/102039] another case of template function signature incorrectly dropping top-level cv-qualifier with function parameter dependent on template argument Date: Fri, 15 Oct 2021 21:00:42 +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: 10.2.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned 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 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, 15 Oct 2021 21:00:42 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102039 --- Comment #2 from CVS Commits --- The master branch has been updated by Jason Merrill : https://gcc.gnu.org/g:79802c5dcc043a515f429bb2bec7573b8537c32a commit r12-4453-g79802c5dcc043a515f429bb2bec7573b8537c32a Author: Jason Merrill Date: Tue Sep 28 10:02:04 2021 -0400 c++: array cv-quals and template specialization [PR101402] PRs 101402, 102033, etc. demonstrated that the fix for PR92010 wasn't handling all cases of the CWG1001/1322 issue with parameter type qual stripping and arrays with templates. The problem turned out to be in determine_specialization, which did an extra substitution without the 9= 2010 fix and then complained that the result didn't match. But just removing that wrong/redundant code meant that we were accepting specializations with different numbers of parameters, because the code = in fn_type_unification that compares types in this case wasn't checking for length mismatch. After fixing that, I realized that fn_type_unification couldn't tell the difference between variadic and non-variadic function types, because the args array doesn't include the terminal void we use to indicate non-variadic function type. So I added it, and made the necessary adjustments. Thanks to qingzhe "nick" huang for the patch = that led me to dig more into this, and the extensive testcases. PR c++/51851 PR c++/101402 PR c++/102033 PR c++/102034 PR c++/102039 PR c++/102044 gcc/cp/ChangeLog: * pt.c (determine_specialization): Remove redundant code. (fn_type_unification): Check for mismatched length. (type_unification_real): Ignore terminal void. (get_bindings): Don't stop at void_list_node. * class.c (resolve_address_of_overloaded_function): Likewise. gcc/testsuite/ChangeLog: * g++.dg/template/fnspec2.C: New test. * g++.dg/template/parm-cv1.C: New test. * g++.dg/template/parm-cv2.C: New test. * g++.dg/template/parm-cv3.C: New test.=