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

--- Comment #11 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Jakub Jelinek
<[email protected]>:

https://gcc.gnu.org/g:19653eac71b9f553e40a73e20d32bcb18b1f1f04

commit r14-12410-g19653eac71b9f553e40a73e20d32bcb18b1f1f04
Author: Jakub Jelinek <[email protected]>
Date:   Tue Feb 17 08:59:06 2026 +0100

    c++: Don't support auto{x} and auto(x) for C++ < 23 in SFINAE contexts
[PR120685]

    The following testcase ICEs in C++ 20 and older, because during
    diagnostics dump_template_bindings attempts to tsubst with tf_none
    something and we try to emit a pedwarn during that.
    While the pedwarn could be just guarded with if (complain & tf_warning),
    I thought we shouldn't support extensions for tf_none and should
    instead return error_mark_node.

    The following patch does that.

    This is a backport version which instead of not supporting it just
    doesn't emit the pedwarn in SFINAE contexts for C++ < 23 but still
    supports it.

    2026-02-17  Jakub Jelinek  <[email protected]>

            PR c++/120685
            * typeck2.cc (build_functional_cast_1): For C++23 auto(x)
            without tf_warning or tf_error return error_mark_node instead of
            emitting pedwarn and handling it.
            * semantics.cc (finish_compound_literal): Similarly for C++26
            auto{x}.

            * g++.dg/cpp23/auto-fncast19.C: New test.

    (cherry picked from commit f7efb7e62ac96c082ff72549d9b3789f5c955efe)

Reply via email to