From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2122) id 2F8643852769; Fri, 1 Dec 2023 21:08:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2F8643852769 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1701464930; bh=Fe2dikwzOWFhnAdOFLWhTzWGIz8NJn46aoJdedwSfVo=; h=From:To:Subject:Date:From; b=vaZYFpU6RodoZBHId01iYihP/RDIZMKocSEw9SsseoFauYp3OuUSWB4tcQwHXmiwA UnhRfgfi9/PAtV8L1LzLaiRa+2MPEZQkBcphpvcdrnhfWrXSxSaHMlhgqwvsLCwzlb TWX2hCU1BHwzoKV1wrHL3bd8jCgEgw80PrUxAxkI= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jason Merrill To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r14-6064] c++: mangle function template constraints X-Act-Checkin: gcc X-Git-Author: Jason Merrill X-Git-Refname: refs/heads/trunk X-Git-Oldrev: c6bb413eeb9d13412e8101e3029099d7fd746708 X-Git-Newrev: c3f281a0c1ca50e4df5049923aa2f5d1c3c39ff6 Message-Id: <20231201210850.2F8643852769@sourceware.org> Date: Fri, 1 Dec 2023 21:08:50 +0000 (GMT) List-Id: https://gcc.gnu.org/g:c3f281a0c1ca50e4df5049923aa2f5d1c3c39ff6 commit r14-6064-gc3f281a0c1ca50e4df5049923aa2f5d1c3c39ff6 Author: Jason Merrill Date: Mon Sep 25 10:15:02 2023 +0100 c++: mangle function template constraints Per https://github.com/itanium-cxx-abi/cxx-abi/issues/24 and https://github.com/itanium-cxx-abi/cxx-abi/pull/166 We need to mangle constraints to be able to distinguish between function templates that only differ in constraints. From the latter link, we want to use the template parameter mangling previously specified for lambdas to also make explicit the form of a template parameter where the argument is not a "natural" fit for it, such as when the parameter is constrained or deduced. I'm concerned about how the latter link changes the mangling for some C++98 and C++11 patterns, so I've limited template_parm_natural_p to avoid two cases found by running the testsuite with -Wabi forced on: template T f() { return V; } int main() { return f(); } template int max() { return i; } template int max() { int sub = max(); return i > sub ? i : sub; } int main() { return max<1,2,3>(); } A third C++11 pattern is changed by this patch: template