c++: fix arm-eabi bootstrap [PR105567]
commit4dc86f716fe6087f1cf786d69c0c6f3f5af810f0
authorJason Merrill <jason@redhat.com>
Wed, 11 May 2022 13:44:57 +0000 (11 09:44 -0400)
committerJason Merrill <jason@redhat.com>
Wed, 11 May 2022 17:50:39 +0000 (11 13:50 -0400)
tree7b5cda30b62f9adc5d5c258f50d79b0110d4ac00
parent0acdbe29f66017fc5cca40dcbd72a0dd41491d07
c++: fix arm-eabi bootstrap [PR105567]

Since my r13-112, in the template we were changing 'return' to 'return this'
on cdtor_returns_this targets, and then getting confused by that when
instantiating.  So only make that change at instantiation time.

PR bootstrap/105567

gcc/cp/ChangeLog:

* typeck.cc (check_return_expr): Don't mess with ctor return value
while parsing a template.

gcc/testsuite/ChangeLog:

* g++.dg/template/ctor10.C: New test.
gcc/cp/typeck.cc
gcc/testsuite/g++.dg/template/ctor10.C [new file with mode: 0644]