public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
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]
Date: Mon, 19 Apr 2021 10:26:56 +0000 (GMT)	[thread overview]
Message-ID: <20210419102656.13087395C81C@sourceware.org> (raw)

https://gcc.gnu.org/g:661dacec8fb149582a2508494ed927ee3387c7f0

commit r8-10851-g661dacec8fb149582a2508494ed927ee3387c7f0
Author: Jonathan Wakely <jwakely@redhat.com>
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 @@
 <br />
       MS adds:<br />
       _T<br />
+			__deref<br />
 <br />
       BSD adds:<br />
       __used<br />
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.
   
   <para>
   </para>
-  <section xml:id="coding_style.bad_identifiers"><info><title>Bad Identifiers</title></info>
-    
+
+  <section xml:id="coding_style.bad_identifiers"><info><title>Bad Identifiers</title></info> <!-- BADNAMES -->
+
     <para>
       Identifiers that conflict and should be avoided.
     </para>
@@ -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<typename _It>
       static typename std::iterator_traits<_It>::reference
-      __deref();
+      __ref();
 
     template<typename _It,
-	     typename = decltype(__deref<_It>() < __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<typename _It, typename _Pred, typename
-	= decltype(std::declval<_Pred>()(__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); }


                 reply	other threads:[~2021-04-19 10:26 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=20210419102656.13087395C81C@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@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).