From: Jason Merrill Date: Mon, 25 Sep 2023 09:15:02 +0000 (+0100) Subject: c++: mangle function template constraints X-Git-Tag: basepoints/gcc-15~4075 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fgcc.git;a=commitdiff_plain;h=c3f281a0c1ca50e4df5049923aa2f5d1c3c39ff6 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