From 9bb3566f7f2d0c25cdb27efa235a1f54be44e55a Mon Sep 17 00:00:00 2001 From: "A. Jiang" Date: Fri, 21 Apr 2023 04:54:20 +0800 Subject: [PATCH] Fuse `` into `` (#3654) --- stl/CMakeLists.txt | 1 - stl/inc/header-units.json | 1 - stl/inc/type_traits | 7 +++- stl/inc/xstddef | 32 ------------------- .../std/tests/GH_001411_core_headers/test.cpp | 1 - .../test.compile.pass.cpp | 2 +- .../test.compile.pass.cpp | 2 +- 7 files changed, 8 insertions(+), 38 deletions(-) delete mode 100644 stl/inc/xstddef diff --git a/stl/CMakeLists.txt b/stl/CMakeLists.txt index 64ee93e90..6c2e456ee 100644 --- a/stl/CMakeLists.txt +++ b/stl/CMakeLists.txt @@ -247,7 +247,6 @@ set(HEADERS ${CMAKE_CURRENT_LIST_DIR}/inc/xnode_handle.h ${CMAKE_CURRENT_LIST_DIR}/inc/xpolymorphic_allocator.h ${CMAKE_CURRENT_LIST_DIR}/inc/xsmf_control.h - ${CMAKE_CURRENT_LIST_DIR}/inc/xstddef ${CMAKE_CURRENT_LIST_DIR}/inc/xstring ${CMAKE_CURRENT_LIST_DIR}/inc/xthreads.h ${CMAKE_CURRENT_LIST_DIR}/inc/xtimec.h diff --git a/stl/inc/header-units.json b/stl/inc/header-units.json index 0d21964d5..345af8adf 100644 --- a/stl/inc/header-units.json +++ b/stl/inc/header-units.json @@ -153,7 +153,6 @@ "xnode_handle.h", "xpolymorphic_allocator.h", "xsmf_control.h", - "xstddef", "xstring", "xthreads.h", "xtimec.h", diff --git a/stl/inc/type_traits b/stl/inc/type_traits index c51ef667b..3d26f56f4 100644 --- a/stl/inc/type_traits +++ b/stl/inc/type_traits @@ -8,8 +8,9 @@ #define _TYPE_TRAITS_ #include #if _STL_COMPILER_PREPROCESSOR +#include #include -#include +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) @@ -19,6 +20,10 @@ _STL_DISABLE_CLANG_WARNINGS #undef new _STD_BEGIN +template +// TRANSITION, CWG-2518: false value attached to a dependent name (for static_assert) +_INLINE_VAR constexpr bool _Always_false = false; + _EXPORT_STD template struct integer_sequence { // sequence of integer parameters static_assert(is_integral_v<_Ty>, "integer_sequence requires T to be an integral type."); diff --git a/stl/inc/xstddef b/stl/inc/xstddef deleted file mode 100644 index ffa37dfcc..000000000 --- a/stl/inc/xstddef +++ /dev/null @@ -1,32 +0,0 @@ -// xstddef internal header (core) - -// Copyright (c) Microsoft Corporation. -// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -#pragma once -#ifndef _XSTDDEF_ -#define _XSTDDEF_ -#include -#if _STL_COMPILER_PREPROCESSOR -#include -#include - -#pragma pack(push, _CRT_PACKING) -#pragma warning(push, _STL_WARNING_LEVEL) -#pragma warning(disable : _STL_DISABLED_WARNINGS) -_STL_DISABLE_CLANG_WARNINGS -#pragma push_macro("new") -#undef new - -_STD_BEGIN -template -// TRANSITION, CWG-2518: false value attached to a dependent name (for static_assert) -_INLINE_VAR constexpr bool _Always_false = false; -_STD_END - -#pragma pop_macro("new") -_STL_RESTORE_CLANG_WARNINGS -#pragma warning(pop) -#pragma pack(pop) -#endif // _STL_COMPILER_PREPROCESSOR -#endif // _XSTDDEF_ diff --git a/tests/std/tests/GH_001411_core_headers/test.cpp b/tests/std/tests/GH_001411_core_headers/test.cpp index 0d5907989..ced205530 100644 --- a/tests/std/tests/GH_001411_core_headers/test.cpp +++ b/tests/std/tests/GH_001411_core_headers/test.cpp @@ -21,7 +21,6 @@ // <__msvc_iter_core.hpp> is included by // should not be included outside of -// is included by // is included by // is included by every public core header diff --git a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp index e48746e4e..39008f014 100644 --- a/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_iterators_misc/test.compile.pass.cpp @@ -1624,7 +1624,7 @@ void typeindex_test() { template void functors_test_impl(Arg val) { - // Following from : + // Following from and : (void) plus()(val, val); (void) minus()(val, val); (void) multiplies()(val, val); diff --git a/tests/std/tests/VSO_0000000_instantiate_type_traits/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_type_traits/test.compile.pass.cpp index 722f6ff98..7d2d94655 100644 --- a/tests/std/tests/VSO_0000000_instantiate_type_traits/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_type_traits/test.compile.pass.cpp @@ -124,7 +124,7 @@ void type_traits_test_impl() { TRAIT_V(is_null_pointer, T); TRAIT_V(is_union, T); TRAIT_V(is_class, T); - TRAIT_V(is_function, T); // from xstddef + TRAIT_V(is_function, T); TRAIT_V(is_fundamental, T); TRAIT_V(is_arithmetic, T); // from xtr1common TRAIT_V(is_object, T);