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

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

https://gcc.gnu.org/g:f7efb7e62ac96c082ff72549d9b3789f5c955efe

commit r16-7539-gf7efb7e62ac96c082ff72549d9b3789f5c955efe
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.

    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.

Reply via email to