| 1 | //===----------------------------------------------------------------------===// |
| 2 | // |
| 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 |
| 6 | // |
| 7 | //===----------------------------------------------------------------------===// |
| 8 | |
| 9 | #include <cstddef> |
| 10 | #include <type_traits> |
| 11 | |
| 12 | #include "test_macros.h" |
| 13 | |
| 14 | // size_t should: |
| 15 | |
| 16 | // 1. be in namespace std. |
| 17 | // 2. be the same sizeof as void*. |
| 18 | // 3. be an unsigned integral. |
| 19 | |
| 20 | int main(int, char**) |
| 21 | { |
| 22 | static_assert(sizeof(std::size_t) == sizeof(void*), |
| 23 | "sizeof(std::size_t) == sizeof(void*)" ); |
| 24 | static_assert(std::is_unsigned<std::size_t>::value, |
| 25 | "std::is_unsigned<std::size_t>::value" ); |
| 26 | static_assert(std::is_integral<std::size_t>::value, |
| 27 | "std::is_integral<std::size_t>::value" ); |
| 28 | |
| 29 | return 0; |
| 30 | } |
| 31 | |