https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124830
Bug ID: 124830
Summary: c/c-decl.cc Fails to cross compile with C++20 host
compiler
Product: gcc
Version: 14.3.1
Status: UNCONFIRMED
Keywords: build
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: rguenth at gcc dot gnu.org
CC: jwakely at redhat dot com
Target Milestone: ---
I see
[ 33s] g++ -fno-PIE -c -DIN_GCC_FRONTEND -O2 -funwind-tables
-fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g
-DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti
-fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings
-Wcast-qual -Wmissing-format-attribute -Wconditionally-supported
-Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros
-Wno-overlength-strings -DHAVE_CONFIG_H -fno-PIE -I. -Ic -I../../gcc
-I../../gcc/c -I../../gcc/../include -I../../gcc/../libcpp/include
-I../../gcc/../libcody -I../../gcc/../libdecnumber
-I../../gcc/../libdecnumber/dpd -I../libdecnumber -I../../gcc/../libbacktrace
-o c/c-decl.o -MT c/c-decl.o -MMD -MP -MF c/.deps/c-decl.TPo
../../gcc/c/c-decl.cc
[ 33s] In file included from /usr/include/c++/16/bits/basic_ios.h:40,
[ 33s] from /usr/include/c++/16/ios:48,
[ 33s] from /usr/include/c++/16/bits/ostream.h:43,
[ 33s] from /usr/include/c++/16/bits/unique_ptr.h:42,
[ 33s] from /usr/include/c++/16/memory:80,
[ 33s] from ../../gcc/system.h:766,
[ 33s] from ../../gcc/c/c-decl.cc:30:
[ 33s] /usr/include/c++/16/bits/locale_facets.h:252:53: error: macro
‘toupper’ passed 2 arguments, but takes just 1
[ 33s] 252 | toupper(char_type *__lo, const char_type* __hi) const
[ 33s] | ^
[ 33s] In file included from ../../gcc/system.h:235:
...
when building the top of the GCC 14 branch with GCC 16. That's from the
system.h
#ifdef INCLUDE_MEMORY
# include <memory>
#endif
and previous INCLUDE_STRING include. We've refactored this quite a bit in
15 where <memory> is always included.
Jonathan, is there anything obviously "wrong" with 14?