[gcc(refs/vendors/redhat/heads/gcc-8-branch)] libstdc++: Fix non-reserved name in header

Jakub Jelinek jakub@gcc.gnu.org
Fri Apr 23 10:16:07 GMT 2021


https://gcc.gnu.org/g:14e259ed86e544e2094f407f68b0202a90263b9b

commit 14e259ed86e544e2094f407f68b0202a90263b9b
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Thu Oct 8 00:05:53 2020 +0100

    libstdc++: Fix non-reserved name in header
    
    There's a "il" parameter in a std::seed_seq constructor in <random>
    which is only reserved since C++14.
    
    libstdc++-v3/ChangeLog:
    
            * include/bits/random.h (seed_seq(initializer_list<T>)): Rename
            parameter to use reserved name.
            * testsuite/17_intro/names.cc: Check "il".
    
    (cherry picked from commit 23f75da95f5e8e09e9fcbd5b0d2885e6c44739aa)

Diff:
---
 libstdc++-v3/include/bits/random.h       | 2 +-
 libstdc++-v3/testsuite/17_intro/names.cc | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/include/bits/random.h b/libstdc++-v3/include/bits/random.h
index ccd5c834db8..50da41615d5 100644
--- a/libstdc++-v3/include/bits/random.h
+++ b/libstdc++-v3/include/bits/random.h
@@ -5968,7 +5968,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     { }
 
     template<typename _IntType>
-      seed_seq(std::initializer_list<_IntType> il);
+      seed_seq(std::initializer_list<_IntType> __il);
 
     template<typename _InputIterator>
       seed_seq(_InputIterator __begin, _InputIterator __end);
diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc
index dad7ba970aa..d758138dfb1 100644
--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -104,6 +104,11 @@
 #define uses_allocator  (
 #endif
 
+#if __cplusplus < 201402L
+// <complex> defines operator""il
+#define il  (
+#endif
+
 #if __cplusplus < 201703L
 // <charconv> defines to_chars_result::ptr and to_chars_result::ec
 #define ec (


More information about the Libstdc++-cvs mailing list