From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 8BABF3857433; Mon, 10 May 2021 14:00:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 8BABF3857433 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-675] libstdc++: Rename test type to avoid clashing with std::any X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 0fd1a54ba32df4316ea920e9877c66f79605df50 X-Git-Newrev: 2bbacc18b35e44d45676a46eced26129f8f8378a Message-Id: <20210510140040.8BABF3857433@sourceware.org> Date: Mon, 10 May 2021 14:00:40 +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: Mon, 10 May 2021 14:00:40 -0000 https://gcc.gnu.org/g:2bbacc18b35e44d45676a46eced26129f8f8378a commit r12-675-g2bbacc18b35e44d45676a46eced26129f8f8378a Author: Jonathan Wakely 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 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: --- 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, 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()