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 r11-8384] libstdc++: Rename test type to avoid clashing with std::any
Date: Tue, 11 May 2021 19:51:00 +0000 (GMT)	[thread overview]
Message-ID: <20210511195100.A9938388CC14@sourceware.org> (raw)

https://gcc.gnu.org/g:441ff687457f0d713d20ae7440309d0b83dd202e

commit r11-8384-g441ff687457f0d713d20ae7440309d0b83dd202e
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon May 10 13:57:49 2021 +0100

    libstdc++: Rename test type to avoid clashing with std::any
    
    When PCH are enabled this test file includes <any> and so the
    using-directive brings std::any into the global scope. It isn't
    currently a problem, because the -std option in the dg-options means
    that PCH is not used. If that option is removed, the test fails with PCH
    and passes without.
    
    This just renames the type to avoid the name classh (and also the 'none'
    type for consistency).
    
    libstdc++-v3/ChangeLog:
    
            * testsuite/20_util/variant/compile.cc: Rename 'any' to avoid
            clash with std::any.
    
    (cherry picked from commit 2bbacc18b35e44d45676a46eced26129f8f8378a)

Diff:
---
 libstdc++-v3/testsuite/20_util/variant/compile.cc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/libstdc++-v3/testsuite/20_util/variant/compile.cc b/libstdc++-v3/testsuite/20_util/variant/compile.cc
index 33f198c2cc3..e5042751e66 100644
--- a/libstdc++-v3/testsuite/20_util/variant/compile.cc
+++ b/libstdc++-v3/testsuite/20_util/variant/compile.cc
@@ -172,15 +172,15 @@ void arbitrary_ctor()
   static_assert(is_constructible_v<variant<bool, int>, ConvertibleToBool>);
 }
 
-struct none { none() = delete; };
-struct any { template <typename T> any(T&&) {} };
+struct None { None() = delete; };
+struct Any { template <typename T> Any(T&&) {} };
 
 void in_place_index_ctor()
 {
   variant<string, string> a(in_place_index<0>, "a");
   variant<string, string> b(in_place_index<1>, {'a'});
 
-  static_assert(!is_constructible_v<variant<none, any>, std::in_place_index_t<0>>, "PR libstdc++/90165");
+  static_assert(!is_constructible_v<variant<None, Any>, std::in_place_index_t<0>>, "PR libstdc++/90165");
 }
 
 void in_place_type_ctor()
@@ -188,7 +188,7 @@ void in_place_type_ctor()
   variant<int, string, int> a(in_place_type<string>, "a");
   variant<int, string, int> b(in_place_type<string>, {'a'});
   static_assert(!is_constructible_v<variant<string, string>, in_place_type_t<string>, const char*>);
-  static_assert(!is_constructible_v<variant<none, any>, std::in_place_type_t<none>>, "PR libstdc++/90165");
+  static_assert(!is_constructible_v<variant<None, Any>, std::in_place_type_t<None>>, "PR libstdc++/90165");
 }
 
 void dtor()


                 reply	other threads:[~2021-05-11 19:51 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=20210511195100.A9938388CC14@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).