public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: [committed] libstdc++: Fix non-reserved names in <valarray>
Date: Thu, 26 Aug 2021 00:08:42 +0100	[thread overview]
Message-ID: <YSbNejccvfzKlfUM@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 231 bytes --]

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.

Tested powerpc64le-linux. Committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 3353 bytes --]

commit 0163bbaaef119ef9e98c4b3dcba159609f77c818
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Wed Aug 25 22:24:54 2021

    libstdc++: Fix non-reserved names in <valarray>
    
    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.

diff --git a/libstdc++-v3/include/std/valarray b/libstdc++-v3/include/std/valarray
index ad3e14ebe52..5adc94282ee 100644
--- a/libstdc++-v3/include/std/valarray
+++ b/libstdc++-v3/include/std/valarray
@@ -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)                     \
diff --git a/libstdc++-v3/testsuite/17_intro/names.cc b/libstdc++-v3/testsuite/17_intro/names.cc
index aca7a8e5812..3cbe0d2da54 100644
--- a/libstdc++-v3/testsuite/17_intro/names.cc
+++ b/libstdc++-v3/testsuite/17_intro/names.cc
@@ -106,6 +106,7 @@
 #endif
 #define z (
 
+#define func (
 #define tmp (
 
 #if __cplusplus < 201103L

                 reply	other threads:[~2021-08-25 23:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YSbNejccvfzKlfUM@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).