From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id A9938388CC14; Tue, 11 May 2021 19:51:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A9938388CC14 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 r11-8384] libstdc++: Rename test type to avoid clashing with std::any X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 43d3309d98c10f4fde6f12686220fa3e9f4044cf X-Git-Newrev: 441ff687457f0d713d20ae7440309d0b83dd202e Message-Id: <20210511195100.A9938388CC14@sourceware.org> Date: Tue, 11 May 2021 19:51:00 +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: Tue, 11 May 2021 19:51:00 -0000 https://gcc.gnu.org/g:441ff687457f0d713d20ae7440309d0b83dd202e commit r11-8384-g441ff687457f0d713d20ae7440309d0b83dd202e 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. (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, 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()