1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
13 #include <type_traits>
14 #include "test_macros.h"
19 static_assert(!std::is_const
<T
>::value
, "");
20 static_assert( std::is_const
<const T
>::value
, "");
21 static_assert(!std::is_const
<volatile T
>::value
, "");
22 static_assert( std::is_const
<const volatile T
>::value
, "");
24 static_assert(!std::is_const_v
<T
>, "");
25 static_assert( std::is_const_v
<const T
>, "");
26 static_assert(!std::is_const_v
<volatile T
>, "");
27 static_assert( std::is_const_v
<const volatile T
>, "");
31 struct A
; // incomplete
35 test_is_const
<void>();
37 test_is_const
<double>();
38 test_is_const
<int*>();
39 test_is_const
<const int*>();
40 test_is_const
<char[3]>();
41 test_is_const
<char[]>();
45 static_assert(!std::is_const
<int&>::value
, "");
46 static_assert(!std::is_const
<const int&>::value
, "");