]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: fix conversion issues
authorJason Merrill <jason@redhat.com>
Tue, 24 Dec 2024 00:57:56 +0000 (19:57 -0500)
committerJason Merrill <jason@redhat.com>
Wed, 8 Jan 2025 21:34:58 +0000 (16:34 -0500)
commitdd3f3c71df66ed6fd3872ab780f5813831100d1c
tree340d2b2733ba7b87e2eaeede49508c175594cee2
parent7eec6fedf457883adc8222b2f4a3230311f8f25f
c++: fix conversion issues

Some issues caught by a check from another patch:

In the convert_like_internal bad_p handling, we are iterating from outside
to inside, so once we recurse into convert_like we need to stop looping.

In build_ramp_function, we're assigning REFERENCE_TYPE things, so we need to
build the assignment directly rather than rely on functions that implement
C++ semantics.

In omp_declare_variant_finalize_one, the parameter object building failed to
handle reference parms, and it seems simpler to just use build_stub_object
like other parts of the compiler.

gcc/cp/ChangeLog:

* call.cc (convert_like_internal): Add missing break.
* coroutines.cc (cp_coroutine_transform::build_ramp_function): Build
INIT_EXPR directly.
* decl.cc (omp_declare_variant_finalize_one): Use build_stub_object.

gcc/testsuite/ChangeLog:

* g++.dg/gomp/declare-variant-3.C: Don't depend on expr dump.
* g++.dg/gomp/declare-variant-5.C: Likewise.
gcc/cp/call.cc
gcc/cp/coroutines.cc
gcc/cp/decl.cc
gcc/testsuite/g++.dg/gomp/declare-variant-3.C
gcc/testsuite/g++.dg/gomp/declare-variant-5.C