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

--- Comment #17 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>:

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

commit r16-3413-gf707c093dee0468a3ef837a6c40afcf4c7fa7e46
Author: Jakub Jelinek <ja...@redhat.com>
Date:   Wed Aug 27 14:00:51 2025 +0200

    c++: Fix up cpp_warn on __STDCPP_FLOAT*_T__ [PR121520]

    I got the cpp_warn on __STDCPP_FLOAT*_T__ if we aren't predefining those
    wrong, so e.g. on powerpc64le we don't diagnose #undef
__STDCPP_FLOAT16_T__.
    I've added it as else if on the
    if (c_dialect_cxx () && cxx_dialect > cxx20 &&
!floatn_nx_types[i].extended)
    condition, which means cpp_warn is called in case a target supports some
    extended type like _Float32x, cpp_warn is called on __STDCPP_FLOAT32_T__
    (where when it supported _Float32 as well it did cpp_define_warn
    (pfile, "__STDCPP_FLOAT32_T__=1") earlier).
    On targets where the types aren't supported the earlier
    if (FLOATN_NX_TYPE_NODE (i) == NULL_TREE) continue;
    path is taken.

    This patch fixes it to cpp_warn on the non-extended types for C++23
    if the target doesn't support them and cpp_define_warn as before if it
does.

    2025-08-27  Jakub Jelinek  <ja...@redhat.com>

            PR target/121520
            * c-cppbuiltin.cc (c_cpp_builtins): Properly call cpp_warn
            for __STDCPP_FLOAT<NN>_T__ if FLOATN_NX_TYPE_NODE (i) is NULL
            for C++23 for non-extended types and don't call cpp_warn for
            extended types.
  • [Bug target/121520] [16 regress... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to