[Bug c/124830] [13/14 only] c/c-decl.cc Fails to cross compile with C++20 host compiler

2026-04-09 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124830

Richard Biener  changed:

   What|Removed |Added

 Resolution|--- |FIXED
 Status|ASSIGNED|RESOLVED

--- Comment #12 from Richard Biener  ---
Fixed for me.

[Bug c/124830] [13/14 only] c/c-decl.cc Fails to cross compile with C++20 host compiler

2026-04-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124830

--- Comment #11 from GCC Commits  ---
The releases/gcc-13 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:9239757a9c6e3a6e8d94d56803329d556ec914d7

commit r13-10253-g9239757a9c6e3a6e8d94d56803329d556ec914d7
Author: Andrew Pinski 
Date:   Mon Nov 25 14:03:27 2024 -0800

build: Move sstream and memory include above safe-ctype.h [PR124830]

This picks r15-5661-gf6e00226a4ca6 to older branches, also moving
the  include to fix build issues with a C++20 host compiler.

sstream in some versions of libstdc++ include locale which might not have
been
included yet. safe-ctype.h defines the toupper, tolower, etc. as macros so
the
c++ header files needed to be included before hand as comment in system.h
says:
/* Include C++ standard headers before "safe-ctype.h" to avoid GCC
   poisoning the ctype macros through safe-ctype.h */

I don't understand how it was working before when memory was included after
safe-ctype.h rather than before. But this makes sstream consistent with the
other C++ headers.

gcc/ChangeLog:

PR target/117771
PR c/124830
* system.h: Move the include of sstream and memory above
safe-ctype.h.

Signed-off-by: Andrew Pinski 
(cherry picked from commit 046776dac7cc74bdbab36f450af80644a045858a)

[Bug c/124830] [13/14 only] c/c-decl.cc Fails to cross compile with C++20 host compiler

2026-04-09 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124830

--- Comment #10 from GCC Commits  ---
The releases/gcc-14 branch has been updated by Richard Biener
:

https://gcc.gnu.org/g:046776dac7cc74bdbab36f450af80644a045858a

commit r14-12513-g046776dac7cc74bdbab36f450af80644a045858a
Author: Andrew Pinski 
Date:   Mon Nov 25 14:03:27 2024 -0800

build: Move sstream and memory include above safe-ctype.h [PR124830]

This picks r15-5661-gf6e00226a4ca6 to older branches, also moving
the  include to fix build issues with a C++20 host compiler.

sstream in some versions of libstdc++ include locale which might not have
been
included yet. safe-ctype.h defines the toupper, tolower, etc. as macros so
the
c++ header files needed to be included before hand as comment in system.h
says:
/* Include C++ standard headers before "safe-ctype.h" to avoid GCC
   poisoning the ctype macros through safe-ctype.h */

I don't understand how it was working before when memory was included after
safe-ctype.h rather than before. But this makes sstream consistent with the
other C++ headers.

gcc/ChangeLog:

PR target/117771
PR c/124830
* system.h: Move the include of sstream and memory above
safe-ctype.h.

Signed-off-by: Andrew Pinski 

[Bug c/124830] [13/14 only] c/c-decl.cc Fails to cross compile with C++20 host compiler

2026-04-09 Thread rguenth at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124830

--- Comment #9 from Richard Biener  ---
I'll just bring branches in-line with what we effectively have on 15/trunk, not
doing any further changes there.

[Bug c/124830] [13/14 only] c/c-decl.cc Fails to cross compile with C++20 host compiler

2026-04-09 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124830

--- Comment #8 from Jakub Jelinek  ---
In this case I think it is r15-5603 instead (but one really doesn't need to
remove INCLUDE_MEMORY, but just move it earlier).
In fact, I wonder why we include "safe-ctype.h" so early in system.h, before
many other system (both C and C++) includes.
I'd put it after the isl includes or so.
Or rather move all the #include <...> stuff earlier before we start redefining
macros etc.

[Bug c/124830] [13/14 only] c/c-decl.cc Fails to cross compile with C++20 host compiler

2026-04-09 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124830

Drea Pinski  changed:

   What|Removed |Added

   Target Milestone|--- |13.5
Summary|c/c-decl.cc Fails to cross  |[13/14 only] c/c-decl.cc
   |compile with C++20 host |Fails to cross compile with
   |compiler|C++20 host compiler

--- Comment #7 from Drea Pinski  ---
Note I don't think this is due to C++20 default compiler just libstdc++ stopped
including some headers earlier and only memory includes locale now; just like
how PR 117771 happened.