diff --git a/src/hotspot/share/metaprogramming/decay.hpp b/src/hotspot/share/metaprogramming/decay.hpp index f504c099e4d..1cbd45454cf 100644 --- a/src/hotspot/share/metaprogramming/decay.hpp +++ b/src/hotspot/share/metaprogramming/decay.hpp @@ -26,16 +26,17 @@ #define SHARE_METAPROGRAMMING_DECAY_HPP #include "memory/allStatic.hpp" -#include "metaprogramming/removeCV.hpp" #include "metaprogramming/removeReference.hpp" +#include + // This trait trims the type from CV qualifiers and references. // This trait provides a subset of the functionality of std::decay; // array types and function types are not supported here. template struct Decay: AllStatic { - typedef typename RemoveCV::type>::type type; + using type = std::remove_cv_t::type>; }; #endif // SHARE_METAPROGRAMMING_DECAY_HPP diff --git a/src/hotspot/share/metaprogramming/isIntegral.hpp b/src/hotspot/share/metaprogramming/isIntegral.hpp index cbae6bd5efc..f191f0fbc6e 100644 --- a/src/hotspot/share/metaprogramming/isIntegral.hpp +++ b/src/hotspot/share/metaprogramming/isIntegral.hpp @@ -28,15 +28,16 @@ #include "metaprogramming/integralConstant.hpp" #include "metaprogramming/isSigned.hpp" -#include "metaprogramming/removeCV.hpp" + #include +#include // This metafunction returns true iff the type T (irrespective of CV qualifiers) // is an integral type. Note that this is false for enums. template struct IsIntegral - : public IntegralConstant::type>::is_integer> + : public IntegralConstant::type>::is_integer> {}; // This metafunction returns true iff the type T (irrespective of CV qualifiers) diff --git a/src/hotspot/share/metaprogramming/isSigned.hpp b/src/hotspot/share/metaprogramming/isSigned.hpp index f04065d2180..2023d656b3c 100644 --- a/src/hotspot/share/metaprogramming/isSigned.hpp +++ b/src/hotspot/share/metaprogramming/isSigned.hpp @@ -26,12 +26,13 @@ #define SHARE_METAPROGRAMMING_ISSIGNED_HPP #include "metaprogramming/integralConstant.hpp" -#include "metaprogramming/removeCV.hpp" + #include +#include template struct IsSigned - : public IntegralConstant::type>::is_signed> + : public IntegralConstant::type>::is_signed> {}; #endif // SHARE_METAPROGRAMMING_ISSIGNED_HPP diff --git a/src/hotspot/share/metaprogramming/removeCV.hpp b/src/hotspot/share/metaprogramming/removeCV.hpp deleted file mode 100644 index 5ddafc54746..00000000000 --- a/src/hotspot/share/metaprogramming/removeCV.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2017, 2022, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_METAPROGRAMMING_REMOVECV_HPP -#define SHARE_METAPROGRAMMING_REMOVECV_HPP - -#include "memory/allStatic.hpp" - -template -struct RemoveCV: AllStatic { - typedef T type; -}; - -template -struct RemoveCV: AllStatic { - typedef T type; -}; - -template -struct RemoveCV: AllStatic { - typedef T type; -}; - -template -struct RemoveCV: AllStatic { - typedef T type; -}; - -#endif // SHARE_METAPROGRAMMING_REMOVECV_HPP diff --git a/src/hotspot/share/runtime/atomic.hpp b/src/hotspot/share/runtime/atomic.hpp index 03f838345f6..43ec27d4abe 100644 --- a/src/hotspot/share/runtime/atomic.hpp +++ b/src/hotspot/share/runtime/atomic.hpp @@ -32,12 +32,12 @@ #include "metaprogramming/isPointer.hpp" #include "metaprogramming/isSame.hpp" #include "metaprogramming/primitiveConversions.hpp" -#include "metaprogramming/removeCV.hpp" #include "metaprogramming/removePointer.hpp" #include "runtime/orderAccess.hpp" #include "utilities/align.hpp" #include "utilities/bytes.hpp" #include "utilities/macros.hpp" + #include enum atomic_memory_order { @@ -794,8 +794,8 @@ template struct Atomic::CmpxchgImpl< D*, U*, T*, typename EnableIf::value && - IsSame::type, - typename RemoveCV::type>::value>::type> + IsSame, + std::remove_cv_t>::value>::type> { D* operator()(D* volatile* dest, U* compare_value, T* exchange_value, atomic_memory_order order) const { diff --git a/test/hotspot/gtest/metaprogramming/test_removeCV.cpp b/test/hotspot/gtest/metaprogramming/test_removeCV.cpp deleted file mode 100644 index a91f5aa6e86..00000000000 --- a/test/hotspot/gtest/metaprogramming/test_removeCV.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "memory/allocation.hpp" -#include "metaprogramming/removeCV.hpp" -#include "metaprogramming/isSame.hpp" -#include "utilities/debug.hpp" - -class RemoveCVTest { - class A: AllStatic {}; - - typedef const A cA; - typedef volatile A vA; - typedef const volatile A cvA; - typedef A* Aptr; - typedef const A* cAptr; - typedef A* const Aptrc; - typedef const A* const cAptrc; - typedef A& Aref; - typedef const A& cAref; - - typedef RemoveCV::type rcv_A; - static const bool rcv_A_is_A = IsSame::value; - STATIC_ASSERT(rcv_A_is_A); - - typedef RemoveCV::type rcv_cA; - static const bool rcv_cA_is_A = IsSame::value; - STATIC_ASSERT(rcv_cA_is_A); - - typedef RemoveCV::type rcv_vA; - static const bool rcv_vA_is_A = IsSame::value; - STATIC_ASSERT(rcv_vA_is_A); - - typedef RemoveCV::type rcv_cvA; - static const bool rcv_cvA_is_A = IsSame::value; - STATIC_ASSERT(rcv_cvA_is_A); - - typedef RemoveCV::type rcv_cAptr; - static const bool rcv_cAptr_is_cAptr = IsSame::value; - STATIC_ASSERT(rcv_cAptr_is_cAptr); - - typedef RemoveCV::type rcv_Aptrc; - static const bool rcv_Aptrc_is_Aptr = IsSame::value; - STATIC_ASSERT(rcv_Aptrc_is_Aptr); - - typedef RemoveCV::type rcv_cAptrc; - static const bool rcv_cAptrc_is_cAptr = IsSame::value; - STATIC_ASSERT(rcv_cAptrc_is_cAptr); - - typedef RemoveCV::type rcv_cAref; - static const bool rcv_cAref_is_cAref = IsSame::value; - STATIC_ASSERT(rcv_cAref_is_cAref); -};