https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118791

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at redhat dot com

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to sandra from comment #3)
> Curiously, on the OG14 development branch the rvalue calls work but the
> lvalue ones are broken instead:

Confirmed with GCC 14.

This is caused by the following patch - which changes whether one or the
other fails in the static assert. Namely:

// FAILS with:  7eec6fedf45
// OK with      dd3f3c71df6
  int lvalue = 0;
  lvalue_int<int&>(lvalue);
  lvalue_const_int<int const&>(static_cast<int const&>(lvalue));

// OK for:  7eec6fedf45
// FAILS with dd3f3c71df6
  rvalue_int<int&&>(0);
  rvalue_const_int<int const&&>(static_cast<int const&&>(0));

* * *

The patch that caused the flip is:

r15-6707-gdd3f3c71df66ed

commit dd3f3c71df66ed6fd3872ab780f5813831100d1c (HEAD)
Author:     Jason Merrill
AuthorDate: Mon Dec 23 19:57:56 2024 -0500
CommitDate: Wed Jan 8 16:34:58 2025 -0500

    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.

Reply via email to