Path: blob/master/test/hotspot/gtest/metaprogramming/test_removeCV.cpp
41145 views
/*1* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324#include "precompiled.hpp"25#include "memory/allocation.hpp"26#include "metaprogramming/removeCV.hpp"27#include "metaprogramming/isSame.hpp"28#include "utilities/debug.hpp"2930class RemoveCVTest {31class A: AllStatic {};3233typedef const A cA;34typedef volatile A vA;35typedef const volatile A cvA;36typedef A* Aptr;37typedef const A* cAptr;38typedef A* const Aptrc;39typedef const A* const cAptrc;40typedef A& Aref;41typedef const A& cAref;4243typedef RemoveCV<A>::type rcv_A;44static const bool rcv_A_is_A = IsSame<rcv_A, A>::value;45STATIC_ASSERT(rcv_A_is_A);4647typedef RemoveCV<cA>::type rcv_cA;48static const bool rcv_cA_is_A = IsSame<rcv_cA, A>::value;49STATIC_ASSERT(rcv_cA_is_A);5051typedef RemoveCV<vA>::type rcv_vA;52static const bool rcv_vA_is_A = IsSame<rcv_vA, A>::value;53STATIC_ASSERT(rcv_vA_is_A);5455typedef RemoveCV<cvA>::type rcv_cvA;56static const bool rcv_cvA_is_A = IsSame<rcv_cvA, A>::value;57STATIC_ASSERT(rcv_cvA_is_A);5859typedef RemoveCV<cAptr>::type rcv_cAptr;60static const bool rcv_cAptr_is_cAptr = IsSame<rcv_cAptr, cAptr>::value;61STATIC_ASSERT(rcv_cAptr_is_cAptr);6263typedef RemoveCV<Aptrc>::type rcv_Aptrc;64static const bool rcv_Aptrc_is_Aptr = IsSame<rcv_Aptrc, Aptr>::value;65STATIC_ASSERT(rcv_Aptrc_is_Aptr);6667typedef RemoveCV<cAptrc>::type rcv_cAptrc;68static const bool rcv_cAptrc_is_cAptr = IsSame<rcv_cAptrc, cAptr>::value;69STATIC_ASSERT(rcv_cAptrc_is_cAptr);7071typedef RemoveCV<cAref>::type rcv_cAref;72static const bool rcv_cAref_is_cAref = IsSame<rcv_cAref, cAref>::value;73STATIC_ASSERT(rcv_cAref_is_cAref);74};757677