[gcc r17-2304] gcc/system.h: Allow for '#define INCLUDE_ITERATOR' to '#include <iterator>'

Arsen Arsenovic via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:20b4b5e6b4344dbbf06b8faa8389885bcc7aa544

commit r17-2304-g20b4b5e6b4344dbbf06b8faa8389885bcc7aa544
Author: Thomas Schwinge <[email protected]>
Date:   Wed Jul 8 23:13:17 2026 +0200

    gcc/system.h: Allow for '#define INCLUDE_ITERATOR' to '#include <iterator>'
    
    This avoids:
    
        In file included from /gnu/store/jdibb0iw7n0y56pq3rvz9fmzb4j60acr-gcc-5.5.0/include/c++/bits/basic_ios.h:37:0,
                         from /gnu/store/jdibb0iw7n0y56pq3rvz9fmzb4j60acr-gcc-5.5.0/include/c++/ios:44,
                         from /gnu/store/jdibb0iw7n0y56pq3rvz9fmzb4j60acr-gcc-5.5.0/include/c++/ostream:38,
                         from /gnu/store/jdibb0iw7n0y56pq3rvz9fmzb4j60acr-gcc-5.5.0/include/c++/iterator:64,
                         from ../../source-gcc/gcc/[...]
        /gnu/store/jdibb0iw7n0y56pq3rvz9fmzb4j60acr-gcc-5.5.0/include/c++/bits/locale_facets.h:247:53: error: macro "toupper" passed 2 arguments, but takes just 1
               toupper(char_type *__lo, const char_type* __hi) const
                                                             ^
        [...]
    
            gcc/
            * system.h [INCLUDE_ITERATOR]: '#include <iterator>'.

Diff:
---
 gcc/system.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/gcc/system.h b/gcc/system.h
index 5b8323c28e51..f0fa062d469b 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -228,6 +228,9 @@ extern int fprintf_unlocked (FILE *, const char *, ...);
 #ifdef INCLUDE_SSTREAM
 # include <sstream>
 #endif
+#ifdef INCLUDE_ITERATOR
+# include <iterator>
+#endif
 # include <memory>
 # include <cstring>
 # include <initializer_list>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.