]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: only strip conversions for deduction [PR118632]
authorJason Merrill <jason@redhat.com>
Mon, 27 Jan 2025 17:04:13 +0000 (12:04 -0500)
committerJason Merrill <jason@redhat.com>
Mon, 27 Jan 2025 23:01:56 +0000 (18:01 -0500)
commitc7f16806f3cc8011a3e1bbbf59389df65087f330
tree4cca1277ec2b93040a118e8c68f2185f354a1079
parent019fe9c4d4c7cc9e325b5460d277ebaec108a838
c++: only strip conversions for deduction [PR118632]

In r15-2761 I changed unify to always strip IMPLICIT_CONV_EXPR from PARM.
In this testcase that leads to comparing nullptr to (int*)0, and failing
because they aren't the same.  Let's only strip conversions if we're
actually going to try to deduce template arguments.

While we're at it, let's move this after the early exits.

And with this adjustment we can remove the workaround for mangle57.C.

PR c++/118632

gcc/cp/ChangeLog:

* pt.cc (unify): Only strip conversion if deducible_expression.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/nontype7.C: New test.
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp0x/nontype7.C [new file with mode: 0644]