From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id F3E3A3857433 for ; Mon, 10 May 2021 14:00:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F3E3A3857433 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-34-DqBHKGecOxC122u2cszwfQ-1; Mon, 10 May 2021 10:00:51 -0400 X-MC-Unique: DqBHKGecOxC122u2cszwfQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4FCC5100A68D; Mon, 10 May 2021 14:00:50 +0000 (UTC) Received: from localhost (unknown [10.33.36.164]) by smtp.corp.redhat.com (Postfix) with ESMTP id F26435E7A2; Mon, 10 May 2021 14:00:49 +0000 (UTC) Date: Mon, 10 May 2021 15:00:49 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Rename test type to avoid clashing with std::any Message-ID: MIME-Version: 1.0 X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="b1NOus8ui2O9WSIO" Content-Disposition: inline X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2021 14:00:55 -0000 --b1NOus8ui2O9WSIO Content-Type: text/plain; charset=us-ascii Content-Disposition: inline When PCH are enabled this test file includes 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. Tested powerpc64le-linux. Committed to trunk. --b1NOus8ui2O9WSIO Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="patch.txt" commit 2bbacc18b35e44d45676a46eced26129f8f8378a Author: Jonathan Wakely Date: Mon May 10 13:57:49 2021 libstdc++: Rename test type to avoid clashing with std::any When PCH are enabled this test file includes 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. 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, ConvertibleToBool>); } -struct none { none() = delete; }; -struct any { template any(T&&) {} }; +struct None { None() = delete; }; +struct Any { template Any(T&&) {} }; void in_place_index_ctor() { variant a(in_place_index<0>, "a"); variant b(in_place_index<1>, {'a'}); - static_assert(!is_constructible_v, std::in_place_index_t<0>>, "PR libstdc++/90165"); + static_assert(!is_constructible_v, std::in_place_index_t<0>>, "PR libstdc++/90165"); } void in_place_type_ctor() @@ -188,7 +188,7 @@ void in_place_type_ctor() variant a(in_place_type, "a"); variant b(in_place_type, {'a'}); static_assert(!is_constructible_v, in_place_type_t, const char*>); - static_assert(!is_constructible_v, std::in_place_type_t>, "PR libstdc++/90165"); + static_assert(!is_constructible_v, std::in_place_type_t>, "PR libstdc++/90165"); } void dtor() --b1NOus8ui2O9WSIO--