]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix non-reserved names in <valarray>
authorJonathan Wakely <jwakely@redhat.com>
Wed, 25 Aug 2021 21:24:54 +0000 (22:24 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 25 Aug 2021 21:29:26 +0000 (22:29 +0100)
Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

* include/std/valarray: Uglify 'func' parameters.
* testsuite/17_intro/names.cc: Add 'func' to checks.

libstdc++-v3/include/std/valarray
libstdc++-v3/testsuite/17_intro/names.cc

index ad3e14ebe52c6d09c7a8603b7a49e8193b8c218d..5adc94282eed53569c0f4679605d8469f3acd5ab 100644 (file)
@@ -536,25 +536,25 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
        *  @brief  Apply a function to the array.
        *
        *  Returns a new valarray with elements assigned to the result of
-       *  applying func to the corresponding element of this array.  The new
+       *  applying __func to the corresponding element of this array.  The new
        *  array has the same size as this one.
        *
-       *  @param  func  Function of Tp returning Tp to apply.
+       *  @param  __func  Function of Tp returning Tp to apply.
        *  @return  New valarray with transformed elements.
        */
-      _Expr<_ValFunClos<_ValArray, _Tp>, _Tp> apply(_Tp func(_Tp)) const;
+      _Expr<_ValFunClos<_ValArray, _Tp>, _Tp> apply(_Tp __func(_Tp)) const;
 
       /**
        *  @brief  Apply a function to the array.
        *
        *  Returns a new valarray with elements assigned to the result of
-       *  applying func to the corresponding element of this array.  The new
+       *  applying __func to the corresponding element of this array.  The new
        *  array has the same size as this one.
        *
-       *  @param  func  Function of const Tp& returning Tp to apply.
+       *  @param  __func  Function of const Tp& returning Tp to apply.
        *  @return  New valarray with transformed elements.
        */
-      _Expr<_RefFunClos<_ValArray, _Tp>, _Tp> apply(_Tp func(const _Tp&)) const;
+      _Expr<_RefFunClos<_ValArray, _Tp>, _Tp> apply(_Tp __func(const _Tp&)) const;
 
       /**
        *  @brief  Resize array.
@@ -1062,18 +1062,18 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
   template<class _Tp>
     inline _Expr<_ValFunClos<_ValArray, _Tp>, _Tp>
-    valarray<_Tp>::apply(_Tp func(_Tp)) const
+    valarray<_Tp>::apply(_Tp __func(_Tp)) const
     {
       typedef _ValFunClos<_ValArray, _Tp> _Closure;
-      return _Expr<_Closure, _Tp>(_Closure(*this, func));
+      return _Expr<_Closure, _Tp>(_Closure(*this, __func));
     }
 
   template<class _Tp>
     inline _Expr<_RefFunClos<_ValArray, _Tp>, _Tp>
-    valarray<_Tp>::apply(_Tp func(const _Tp &)) const
+    valarray<_Tp>::apply(_Tp __func(const _Tp &)) const
     {
       typedef _RefFunClos<_ValArray, _Tp> _Closure;
-      return _Expr<_Closure, _Tp>(_Closure(*this, func));
+      return _Expr<_Closure, _Tp>(_Closure(*this, __func));
     }
 
 #define _DEFINE_VALARRAY_UNARY_OPERATOR(_Op, _Name)                     \
index aca7a8e5812e26562832beb0584338418d53c918..3cbe0d2da547061fbddfe332bfa7e5498aa58983 100644 (file)
 #endif
 #define z (
 
+#define func (
 #define tmp (
 
 #if __cplusplus < 201103L