From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id DEFD03858025; Wed, 25 Aug 2021 23:08:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DEFD03858025 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r12-3148] libstdc++: Fix non-reserved names in X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: ead408529d7a69873a7c14dd12fa043cd5862253 X-Git-Newrev: 0163bbaaef119ef9e98c4b3dcba159609f77c818 Message-Id: <20210825230824.DEFD03858025@sourceware.org> Date: Wed, 25 Aug 2021 23:08:24 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Aug 2021 23:08:25 -0000 https://gcc.gnu.org/g:0163bbaaef119ef9e98c4b3dcba159609f77c818 commit r12-3148-g0163bbaaef119ef9e98c4b3dcba159609f77c818 Author: Jonathan Wakely Date: Wed Aug 25 22:24:54 2021 +0100 libstdc++: Fix non-reserved names in Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: * include/std/valarray: Uglify 'func' parameters. * testsuite/17_intro/names.cc: Add 'func' to checks. Diff: --- libstdc++-v3/include/std/valarray | 20 ++++++++++---------- libstdc++-v3/testsuite/17_intro/names.cc | 1 + 2 files changed, 11 insertions(+), 10 deletions(-) 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 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 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