From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 13087395C81C; Mon, 19 Apr 2021 10:26:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13087395C81C MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r8-10851] libstdc++: Replace use of reserved name that clashes [PR 97362] X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-8 X-Git-Oldrev: 9f6c858f76983cbc76d447a06ebce43d98a1fcd2 X-Git-Newrev: 661dacec8fb149582a2508494ed927ee3387c7f0 Message-Id: <20210419102656.13087395C81C@sourceware.org> Date: Mon, 19 Apr 2021 10:26:56 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 10:26:56 -0000 https://gcc.gnu.org/g:661dacec8fb149582a2508494ed927ee3387c7f0 commit r8-10851-g661dacec8fb149582a2508494ed927ee3387c7f0 Author: Jonathan Wakely Date: Sat Oct 10 21:22:12 2020 +0100 libstdc++: Replace use of reserved name that clashes [PR 97362] The name __deref is defined as a macro by Windows headers. This renames the __deref() helper function to __ref. It doesn't actually dereference an iterator. it just has the same type as the iterator's reference type. libstdc++-v3/ChangeLog: PR libstdc++/97362 * doc/html/manual/source_code_style.html: Regenerate. * doc/xml/manual/appendix_contributing.xml: Add __deref to BADNAMES. * include/debug/functions.h (_Irreflexive_checker::__deref): Rename to __ref. (cherry picked from commit 2137aa92412da363d52ef699987441be28b239d0) Diff: --- libstdc++-v3/doc/html/manual/source_code_style.html | 1 + libstdc++-v3/doc/xml/manual/appendix_contributing.xml | 6 ++++-- libstdc++-v3/include/debug/functions.h | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/doc/html/manual/source_code_style.html b/libstdc++-v3/doc/html/manual/source_code_style.html index 19224b7ec13..d1a5804338b 100644 --- a/libstdc++-v3/doc/html/manual/source_code_style.html +++ b/libstdc++-v3/doc/html/manual/source_code_style.html @@ -32,6 +32,7 @@
      MS adds:
      _T
+ __deref

      BSD adds:
      __used
diff --git a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml index eb011cbd4bc..f69ad1f9175 100644 --- a/libstdc++-v3/doc/xml/manual/appendix_contributing.xml +++ b/libstdc++-v3/doc/xml/manual/appendix_contributing.xml @@ -414,8 +414,9 @@ indicate a place that may require attention for multi-thread safety. -
Bad Identifiers - + +
Bad Identifiers + Identifiers that conflict and should be avoided. @@ -447,6 +448,7 @@ indicate a place that may require attention for multi-thread safety. MS adds: _T + __deref BSD adds: __used diff --git a/libstdc++-v3/include/debug/functions.h b/libstdc++-v3/include/debug/functions.h index 57cc6826ce0..8f52326de26 100644 --- a/libstdc++-v3/include/debug/functions.h +++ b/libstdc++-v3/include/debug/functions.h @@ -449,10 +449,10 @@ namespace __gnu_debug { template static typename std::iterator_traits<_It>::reference - __deref(); + __ref(); template() < __deref<_It>())> + typename = decltype(__ref<_It>() < __ref<_It>())> static bool _S_is_valid(_It __it) { return !(*__it < *__it); } @@ -464,7 +464,7 @@ namespace __gnu_debug { return true; } template()(__deref<_It>(), __deref<_It>()))> + = decltype(std::declval<_Pred>()(__ref<_It>(), __ref<_It>()))> static bool _S_is_valid_pred(_It __it, _Pred __pred) { return !__pred(*__it, *__it); }