diff --git a/stl/inc/__msvc_all_public_headers.hpp b/stl/inc/__msvc_all_public_headers.hpp index 912896ed2d9..b238fdb7602 100644 --- a/stl/inc/__msvc_all_public_headers.hpp +++ b/stl/inc/__msvc_all_public_headers.hpp @@ -37,18 +37,52 @@ #define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING #define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS +// Core STL Headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Core C Wrapper Headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef _CORE_HEADERS_ONLY + +// Non-Core STL Headers #include #include #include -#include #include #include #include #include -#include #include -#include -#include #include #include #include @@ -57,28 +91,24 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include #include #include #include -#include #include #include #include @@ -92,16 +122,13 @@ #include #include #include -#include #include #include #include #include -#include #include #include #include -#include #ifndef _M_CEE_PURE #include @@ -120,32 +147,15 @@ #include #endif // _M_CEE -#include +// Non-Core C Wrapper Headers #include -#include -#include -#include -#include -#include #include -#include -#include #include -#include -#include #include -#include #include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include + +// Non-Core Experimental Headers #include #include #include @@ -157,9 +167,10 @@ #include #include +#endif // _CORE_HEADERS_ONLY + #ifndef _MSVC_TESTING_NVCC #include -#include #include #include #include @@ -181,7 +192,6 @@ #include #include #include -#include #include #include #include @@ -207,6 +217,11 @@ #include #include +#ifndef _CORE_HEADERS_ONLY +#include +#include +#endif // _CORE_HEADERS_ONLY + #ifndef _M_CEE_PURE #include #endif // _M_CEE_PURE diff --git a/stl/inc/__msvc_system_error_abi.hpp b/stl/inc/__msvc_system_error_abi.hpp index d6744adf1f2..d95b458cf55 100644 --- a/stl/inc/__msvc_system_error_abi.hpp +++ b/stl/inc/__msvc_system_error_abi.hpp @@ -8,7 +8,7 @@ #define __MSVC_SYSTEM_ERROR_ABI_HPP #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/atomic b/stl/inc/atomic index 349bcc92615..8dfadf62917 100644 --- a/stl/inc/atomic +++ b/stl/inc/atomic @@ -13,9 +13,9 @@ #error is not supported when compiling with /clr:pure. #endif // _M_CEE_PURE -#include // for size_t -#include -#include +#include +#include +#include #include #if _HAS_CXX20 #include diff --git a/stl/inc/barrier b/stl/inc/barrier index 2258cfe26de..fc0eb1df2cd 100644 --- a/stl/inc/barrier +++ b/stl/inc/barrier @@ -18,7 +18,7 @@ #else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv #include -#include +#include #include #include diff --git a/stl/inc/cassert b/stl/inc/cassert index 18b2f2b7778..cf8f3cef253 100644 --- a/stl/inc/cassert +++ b/stl/inc/cassert @@ -1,9 +1,9 @@ -// cassert standard header +// cassert standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // NOTE: no include guard -#include +#include #include diff --git a/stl/inc/cctype b/stl/inc/cctype index d9980f4f33d..cc6c49fe7b3 100644 --- a/stl/inc/cctype +++ b/stl/inc/cctype @@ -1,4 +1,4 @@ -// cctype standard header +// cctype standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CCTYPE_ #define _CCTYPE_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cerrno b/stl/inc/cerrno index efc14b66727..1b5a470c32c 100644 --- a/stl/inc/cerrno +++ b/stl/inc/cerrno @@ -1,4 +1,4 @@ -// cerrno standard header +// cerrno standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CERRNO_ #define _CERRNO_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cfenv b/stl/inc/cfenv index 778dd014a82..c78b9837248 100644 --- a/stl/inc/cfenv +++ b/stl/inc/cfenv @@ -1,4 +1,4 @@ -// cfenv standard header +// cfenv standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CFENV_ #define _CFENV_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/charconv b/stl/inc/charconv index dd3e91acb91..9994d42f528 100644 --- a/stl/inc/charconv +++ b/stl/inc/charconv @@ -12,8 +12,8 @@ #if !_HAS_CXX17 #pragma message("The contents of are available only with C++17 or later.") #else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv +#include #include -#include #include #include #include diff --git a/stl/inc/chrono b/stl/inc/chrono index b19aa83f7cd..d53e2873cb6 100644 --- a/stl/inc/chrono +++ b/stl/inc/chrono @@ -8,10 +8,10 @@ #define _CHRONO_ #include #if _STL_COMPILER_PREPROCESSOR +#include #include #include #include -#include #include #include diff --git a/stl/inc/cinttypes b/stl/inc/cinttypes index 2b130570796..d1f07e10a51 100644 --- a/stl/inc/cinttypes +++ b/stl/inc/cinttypes @@ -1,4 +1,4 @@ -// cinttypes standard header +// cinttypes standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CINTTYPES_ #define _CINTTYPES_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/clocale b/stl/inc/clocale index f725ad9df67..bfc5a0aacff 100644 --- a/stl/inc/clocale +++ b/stl/inc/clocale @@ -1,4 +1,4 @@ -// clocale standard header +// clocale standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CLOCALE_ #define _CLOCALE_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/csetjmp b/stl/inc/csetjmp index 3c25d009937..802ff156e63 100644 --- a/stl/inc/csetjmp +++ b/stl/inc/csetjmp @@ -1,4 +1,4 @@ -// csetjmp standard header +// csetjmp standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CSETJMP_ #define _CSETJMP_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/csignal b/stl/inc/csignal index 077056161ee..fc88191d7dc 100644 --- a/stl/inc/csignal +++ b/stl/inc/csignal @@ -1,4 +1,4 @@ -// csignal standard header +// csignal standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CSIGNAL_ #define _CSIGNAL_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cstdarg b/stl/inc/cstdarg index af09a4fa7d2..f9897bcb17a 100644 --- a/stl/inc/cstdarg +++ b/stl/inc/cstdarg @@ -1,4 +1,4 @@ -// cstdarg standard header +// cstdarg standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CSTDARG_ #define _CSTDARG_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cstring b/stl/inc/cstring index 8c714e9db08..a0140aa307c 100644 --- a/stl/inc/cstring +++ b/stl/inc/cstring @@ -1,4 +1,4 @@ -// cstring standard header +// cstring standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CSTRING_ #define _CSTRING_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/ctime b/stl/inc/ctime index a6f3ddc01a9..94ed91c49c8 100644 --- a/stl/inc/ctime +++ b/stl/inc/ctime @@ -1,4 +1,4 @@ -// ctime standard header +// ctime standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CTIME_ #define _CTIME_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cuchar b/stl/inc/cuchar index 86119e20f87..fc8feb0be82 100644 --- a/stl/inc/cuchar +++ b/stl/inc/cuchar @@ -1,4 +1,4 @@ -// cuchar standard header +// cuchar standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CUCHAR_ #define _CUCHAR_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/cwctype b/stl/inc/cwctype index 567d6642ae7..cfcbe9040ef 100644 --- a/stl/inc/cwctype +++ b/stl/inc/cwctype @@ -1,4 +1,4 @@ -// cwctype standard header +// cwctype standard header (core) // Copyright (c) Microsoft Corporation. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ #pragma once #ifndef _CWCTYPE_ #define _CWCTYPE_ -#include +#include #if _STL_COMPILER_PREPROCESSOR #include diff --git a/stl/inc/experimental/coroutine b/stl/inc/experimental/coroutine index c6ed2a2a292..062973090ba 100644 --- a/stl/inc/experimental/coroutine +++ b/stl/inc/experimental/coroutine @@ -16,7 +16,7 @@ #if _HAS_EXCEPTIONS #include #endif -#include +#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/experimental/resumable b/stl/inc/experimental/resumable index 7f308dd3ecf..0991c7c20d4 100644 --- a/stl/inc/experimental/resumable +++ b/stl/inc/experimental/resumable @@ -15,8 +15,8 @@ #if _HAS_EXCEPTIONS #include #endif +#include #include -#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/latch b/stl/inc/latch index 3743af76484..16eea8b0fed 100644 --- a/stl/inc/latch +++ b/stl/inc/latch @@ -18,7 +18,7 @@ #else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv #include -#include +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/mutex b/stl/inc/mutex index 501fa02c01f..5d781ceff82 100644 --- a/stl/inc/mutex +++ b/stl/inc/mutex @@ -14,7 +14,7 @@ #endif // _M_CEE_PURE #include -#include +#include #include #include #include diff --git a/stl/inc/random b/stl/inc/random index 1854b1f234d..af9a36b5a68 100644 --- a/stl/inc/random +++ b/stl/inc/random @@ -11,8 +11,8 @@ #if _STL_COMPILER_PREPROCESSOR #include #include +#include #include -#include #include #include #include diff --git a/stl/inc/ratio b/stl/inc/ratio index d290147f24a..0a1b09f7619 100644 --- a/stl/inc/ratio +++ b/stl/inc/ratio @@ -8,7 +8,7 @@ #define _RATIO_ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/semaphore b/stl/inc/semaphore index 0845bdf00f3..79d2760603b 100644 --- a/stl/inc/semaphore +++ b/stl/inc/semaphore @@ -19,7 +19,7 @@ #include #include -#include +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/tuple b/stl/inc/tuple index ee6f40fb1e2..7060e6968bd 100644 --- a/stl/inc/tuple +++ b/stl/inc/tuple @@ -8,7 +8,6 @@ #define _TUPLE_ #include #if _STL_COMPILER_PREPROCESSOR -#include #include #include diff --git a/stl/inc/xatomic.h b/stl/inc/xatomic.h index 3298d828ae8..af41c5af67a 100644 --- a/stl/inc/xatomic.h +++ b/stl/inc/xatomic.h @@ -11,9 +11,6 @@ #include #include -#if defined(_WIN64) && (_MSC_FULL_VER <= 192829213) // TRANSITION -#include // Visual Studio 2019 to define 128-bit CAS in -#endif // defined(_WIN64) && (_MSC_FULL_VER <= 192829213), TRANSITION #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/xatomic_wait.h b/stl/inc/xatomic_wait.h index caeb3fdaf9d..42378ea39d3 100644 --- a/stl/inc/xatomic_wait.h +++ b/stl/inc/xatomic_wait.h @@ -9,7 +9,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/xcharconv.h b/stl/inc/xcharconv.h index 9305de5505d..ecd69b6d02e 100644 --- a/stl/inc/xcharconv.h +++ b/stl/inc/xcharconv.h @@ -9,7 +9,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #include diff --git a/stl/inc/xcharconv_ryu.h b/stl/inc/xcharconv_ryu.h index def634d2273..1b2b95a8e05 100644 --- a/stl/inc/xcharconv_ryu.h +++ b/stl/inc/xcharconv_ryu.h @@ -38,7 +38,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #include diff --git a/stl/inc/xcharconv_ryu_tables.h b/stl/inc/xcharconv_ryu_tables.h index cea6fd2b5a8..508d3479fdf 100644 --- a/stl/inc/xcharconv_ryu_tables.h +++ b/stl/inc/xcharconv_ryu_tables.h @@ -38,7 +38,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #if !_HAS_CXX17 #error The contents of are only available with C++17. (Also, you should not include this internal header.) diff --git a/stl/inc/xfilesystem_abi.h b/stl/inc/xfilesystem_abi.h index 7991c1d522e..52f8c8f7404 100644 --- a/stl/inc/xfilesystem_abi.h +++ b/stl/inc/xfilesystem_abi.h @@ -9,7 +9,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/xlocinfo.h b/stl/inc/xlocinfo.h index 9891775d16a..f3e36738c9c 100644 --- a/stl/inc/xlocinfo.h +++ b/stl/inc/xlocinfo.h @@ -9,10 +9,10 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include -#include -#include // TRANSITION, VSO-661721 -#include +#include +#include +#include // TRANSITION, VSO-661721 +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/inc/xthreads.h b/stl/inc/xthreads.h index f2d95ff63d4..c8c88800575 100644 --- a/stl/inc/xthreads.h +++ b/stl/inc/xthreads.h @@ -8,7 +8,7 @@ #define _THR_XTHREADS_H #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #include #pragma pack(push, _CRT_PACKING) diff --git a/stl/inc/xtimec.h b/stl/inc/xtimec.h index 67b75522d16..64741469db9 100644 --- a/stl/inc/xtimec.h +++ b/stl/inc/xtimec.h @@ -9,7 +9,7 @@ #include #if _STL_COMPILER_PREPROCESSOR -#include +#include #pragma pack(push, _CRT_PACKING) #pragma warning(push, _STL_WARNING_LEVEL) diff --git a/stl/src/xstol.cpp b/stl/src/xstol.cpp index 3cd73becd64..0e5f94ba008 100644 --- a/stl/src/xstol.cpp +++ b/stl/src/xstol.cpp @@ -10,8 +10,6 @@ #include #include -#include "xmath.hpp" - _EXTERN_C_UNLESS_PURE _CRTIMP2_PURE unsigned long __CLRCALL_PURE_OR_CDECL _Stoulx(const char*, char**, int, int*); diff --git a/stl/src/xstoll.cpp b/stl/src/xstoll.cpp index 63ad80e1493..4bddd4e19c9 100644 --- a/stl/src/xstoll.cpp +++ b/stl/src/xstoll.cpp @@ -3,13 +3,13 @@ // _Stoll function +#include + #include #include #include #include -#include "xmath.hpp" - _EXTERN_C_UNLESS_PURE _CRTIMP2_PURE unsigned long long __CLRCALL_PURE_OR_CDECL _Stoullx(const char*, char**, int, int*); diff --git a/stl/src/xstoul.cpp b/stl/src/xstoul.cpp index 48f48489b22..9dd8385b8d5 100644 --- a/stl/src/xstoul.cpp +++ b/stl/src/xstoul.cpp @@ -3,6 +3,8 @@ // _Stoul function +#include + #include #include #include @@ -10,15 +12,12 @@ #include #include - _EXTERN_C_UNLESS_PURE -// macros constexpr int _Base_max = 36; // largest valid base // static data -static const char digits[] = // valid digits - "0123456789abcdefghijklmnopqrstuvwxyz"; +static const char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; // valid digits // 32-bits! static const char ndigs[_Base_max + 1] = {0, 0, 33, 21, 17, 14, 13, 12, 11, 11, 10, 10, 9, 9, 9, 9, 9, 8, 8, 8, 8, 8, 8, diff --git a/stl/src/xstoull.cpp b/stl/src/xstoull.cpp index 8a29d7ab260..3deaf903e6e 100644 --- a/stl/src/xstoull.cpp +++ b/stl/src/xstoull.cpp @@ -3,6 +3,8 @@ // _Stoull function +#include + #include #include #include diff --git a/tests/std/test.lst b/tests/std/test.lst index 4140f5fd7cb..33118a0aecc 100644 --- a/tests/std/test.lst +++ b/tests/std/test.lst @@ -169,6 +169,7 @@ tests\GH_001059_hyperbolic_truncation tests\GH_001086_partial_sort_copy tests\GH_001103_countl_zero_correctness tests\GH_001123_random_cast_out_of_range +tests\GH_001411_core_headers tests\LWG2597_complex_branch_cut tests\LWG3018_shared_ptr_function tests\P0019R8_atomic_ref diff --git a/tests/std/tests/GH_001411_core_headers/env.lst b/tests/std/tests/GH_001411_core_headers/env.lst new file mode 100644 index 00000000000..19f025bd0e6 --- /dev/null +++ b/tests/std/tests/GH_001411_core_headers/env.lst @@ -0,0 +1,4 @@ +# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +RUNALL_INCLUDE ..\usual_matrix.lst diff --git a/tests/std/tests/GH_001411_core_headers/test.cpp b/tests/std/tests/GH_001411_core_headers/test.cpp new file mode 100644 index 00000000000..5a45bd65689 --- /dev/null +++ b/tests/std/tests/GH_001411_core_headers/test.cpp @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +#define _CORE_HEADERS_ONLY + +#include <__msvc_all_public_headers.hpp> + +#ifdef _YVALS +#error Core headers should not include . +#endif + +#include + +#ifndef _YVALS +#error Non-core headers like should include . +#endif + +int main() {} // COMPILE-ONLY