From: Jonathan Wakely Date: Mon, 10 May 2021 12:57:49 +0000 (+0100) Subject: libstdc++: Rename test type to avoid clashing with std::any X-Git-Tag: releases/gcc-11.2.0~418 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=441ff687457f0d713d20ae7440309d0b83dd202e;p=thirdparty%2Fgcc.git 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 --git a/libstdc++-v3/testsuite/20_util/variant/compile.cc b/libstdc++-v3/testsuite/20_util/variant/compile.cc index 33f198c2cc37..e5042751e66e 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()