Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add STL4038 prefix to "requires C++NN or later" messages #2061

Merged
merged 29 commits into from
Jul 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
9dea44c
add STL prefix
fsb4000 Jul 15, 2021
c5c3692
fix formating
fsb4000 Jul 15, 2021
f0bd844
use same STL prefix for all headers
fsb4000 Jul 15, 2021
800419b
workaround for nvcc
fsb4000 Jul 15, 2021
d214a8b
add a TRANSITION comment
fsb4000 Jul 16, 2021
f703926
update TRANSITION comment
fsb4000 Jul 20, 2021
e69f298
commenting how STL4033 is used
fsb4000 Aug 8, 2021
40fd70c
Merge branch 'main' into fix155
fsb4000 Aug 8, 2021
368abbb
Merge branch 'main' into fix155
fsb4000 Aug 17, 2021
ebd8ea5
add warning for a new header: stdatomic.h
fsb4000 Aug 17, 2021
a6622ca
Merge branch 'main' into fix155
fsb4000 Sep 11, 2021
62e673e
add STL prefix for spanstream
fsb4000 Sep 11, 2021
5f9bb2a
Merge branch 'main' into fix155
fsb4000 Sep 26, 2021
b8dfa65
Merge branch 'main' into fix155 and fix conflicts
fsb4000 Nov 21, 2021
3dc29bd
Merge branch 'main' into fix155 and fix conflicts
fsb4000 Dec 17, 2021
42c6d69
now the lines are less than 120 characters, so we can remove the work…
fsb4000 Dec 17, 2021
5706ab2
Merge branch 'main' into fix155 and fix conflicts
fsb4000 Jan 26, 2022
54785fb
Merge branch 'main' into fix155 and fix conflicts
fsb4000 May 7, 2022
3f35d06
update warning number because #2583 uses STL4034
fsb4000 May 7, 2022
121e03c
I was blind, use correct warning number.
fsb4000 May 10, 2022
0ec3087
Merge branch 'main' into fix155
fsb4000 May 10, 2022
a3f6339
Merge branch 'main' into fix155 and fix conflicts
fsb4000 May 24, 2022
ae2420e
add warning for a new header: <expected>
fsb4000 May 24, 2022
e21b890
Merge branch 'main' into fix155 and fix conflicts and add prefix for …
fsb4000 Jun 18, 2022
1114f00
clang-format
fsb4000 Jun 18, 2022
b2eff9c
Merge branch 'main' into fix155
StephanTLavavej Jul 22, 2022
0172e28
Code review feedback: Update comment.
StephanTLavavej Jul 23, 2022
98912e4
Code review feedback: `_MESSAGE` => `_STL4038_COROUTINE`
StephanTLavavej Jul 23, 2022
493f931
Code review feedback: STL4039, single line.
StephanTLavavej Jul 23, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stl/inc/any
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#if !_HAS_CXX17
#pragma message("The contents of <any> are available only with C++17 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <any> are available only with C++17 or later."))
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
#include <initializer_list>
#include <type_traits>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/barrier
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#endif // _M_CEE_PURE

#if !_HAS_CXX20
#pragma message("The contents of <barrier> are available only with C++20 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <barrier> are available only with C++20 or later."))
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv

#include <atomic>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/bit
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX20
#pragma message("The contents of <bit> are available only with C++20 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <bit> are available only with C++20 or later."))
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv

#include <intrin0.h>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/charconv
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#if !_HAS_CXX17
#pragma message("The contents of <charconv> are available only with C++17 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <charconv> are available only with C++17 or later."))
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
#include <cstring>
#include <intrin0.h>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/compare
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#if !_HAS_CXX20
#pragma message("The contents of <compare> are available only with C++20 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <compare> are available only with C++20 or later."))
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv
#ifdef __cpp_lib_concepts
#include <bit>
Expand Down
3 changes: 2 additions & 1 deletion stl/inc/concepts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#if _STL_COMPILER_PREPROCESSOR

#ifndef __cpp_lib_concepts
#pragma message("The contents of <concepts> are available only with C++20 concepts support.")
#pragma message( \
_WARNING_MESSAGE("STL4038", "The contents of <concepts> are available only with C++20 concepts support."))
#else // ^^^ !defined(__cpp_lib_concepts) / defined(__cpp_lib_concepts) vvv
#include <type_traits>
#include <vcruntime_new.h>
Expand Down
13 changes: 9 additions & 4 deletions stl/inc/coroutine
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@
#if _STL_COMPILER_PREPROCESSOR

#ifdef _RESUMABLE_FUNCTIONS_SUPPORTED
#pragma message("The contents of <coroutine> are not available with /await.")
#pragma message("Remove /await or use /await:strict for standard coroutines.")
#pragma message("Use <experimental/coroutine> for legacy /await support.")
#define _STL4039_COROUTINE \
"The contents of <coroutine> are not available with /await. " \
"Remove /await or use /await:strict for standard coroutines. " \
"Use <experimental/coroutine> for legacy /await support."
#pragma message(_WARNING_MESSAGE("STL4039", _STL4039_COROUTINE))
#undef _STL4039_COROUTINE // TRANSITION, DevCom-1479701
#else // ^^^ /await ^^^ / vvv no /await vvv
#ifndef __cpp_lib_coroutine
#pragma message("The contents of <coroutine> are available only with C++20 or later or /await:strict.")
#define _STL4038_COROUTINE "The contents of <coroutine> are available only with C++20 or later or /await:strict."
#pragma message(_WARNING_MESSAGE("STL4038", _STL4038_COROUTINE))
#undef _STL4038_COROUTINE // TRANSITION, DevCom-1479701
#else // ^^^ <coroutine> is not available / <coroutine> is available vvv
#ifndef _ALLOW_COROUTINE_ABI_MISMATCH
#pragma detect_mismatch("_COROUTINE_ABI", "2")
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/execution
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#if !_HAS_CXX17
#pragma message("The contents of <execution> are available only with C++17 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <execution> are available only with C++17 or later."))
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
#include <algorithm>
#include <atomic>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/expected
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <yvals.h>
#if _STL_COMPILER_PREPROCESSOR
#ifndef __cpp_lib_expected
#pragma message("The contents of <expected> are available only with C++23 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <expected> are available only with C++23 or later."))
#else // ^^^ !__cpp_lib_expected / __cpp_lib_expected vvv
#include <exception>
#include <initializer_list>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/filesystem
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#if !_HAS_CXX17
#pragma message("The contents of <filesystem> are available only with C++17 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <filesystem> are available only with C++17 or later."))
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
#include <algorithm>
#include <chrono>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/format
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#ifndef __cpp_lib_format
#pragma message("The contents of <format> are available only with C++20 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <format> are available only with C++20 or later."))
#else // ^^^ !defined(__cpp_lib_format) / defined(__cpp_lib_format) vvv

#include <__msvc_format_ucd_tables.hpp>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/latch
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#endif // _M_CEE_PURE

#if !_HAS_CXX20
#pragma message("The contents of <latch> are available only with C++20 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <latch> are available only with C++20 or later."))
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv

#include <atomic>
Expand Down
3 changes: 2 additions & 1 deletion stl/inc/memory_resource
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#if _STL_COMPILER_PREPROCESSOR

#if !_HAS_CXX17
#pragma message("The contents of <memory_resource> are available only with C++17 or later.")
#pragma message( \
_WARNING_MESSAGE("STL4038", "The contents of <memory_resource> are available only with C++17 or later."))
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
#include <vector>
#include <xbit_ops.h>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/numbers
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX20
#pragma message("The contents of <numbers> are available only with C++20 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <numbers> are available only with C++20 or later."))
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv
#ifdef __cpp_lib_concepts
#include <concepts>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/optional
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <yvals.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX17
#pragma message("The contents of <optional> are available only with C++17 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <optional> are available only with C++17 or later."))
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
#if _HAS_CXX20
#include <compare>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/ranges
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#ifndef __cpp_lib_ranges
#pragma message("The contents of <ranges> are available only with C++20 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <ranges> are available only with C++20 or later."))
#else // ^^^ !defined(__cpp_lib_ranges) / defined(__cpp_lib_ranges) vvv
#include <__msvc_int128.hpp>
#include <iosfwd>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/semaphore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#endif // _M_CEE_PURE

#if !_HAS_CXX20
#pragma message("The contents of <semaphore> are available only with C++20 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <semaphore> are available only with C++20 or later."))
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv

#include <__msvc_chrono.hpp>
Expand Down
3 changes: 2 additions & 1 deletion stl/inc/source_location
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
#include <yvals_core.h>
#if _STL_COMPILER_PREPROCESSOR
#ifndef __cpp_consteval
#pragma message("The contents of <source_location> are available only with C++20 consteval support.")
#pragma message( \
_WARNING_MESSAGE("STL4038", "The contents of <source_location> are available only with C++20 consteval support."))
fsb4000 marked this conversation as resolved.
Show resolved Hide resolved
#else // ^^^ !defined(__cpp_consteval) / defined(__cpp_consteval) vvv

#include <cstdint>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/span
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#if !_HAS_CXX20
#pragma message("The contents of <span> are available only with C++20 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <span> are available only with C++20 or later."))
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv
#include <compare>
#include <cstddef>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/spanstream
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <yvals.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX23
#pragma message("The contents of <spanstream> are available only with C++23 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <spanstream> are available only with C++23 or later."))
#else // ^^^ !_HAS_CXX23 / _HAS_CXX23 vvv
#ifdef __cpp_lib_concepts
#include <concepts>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/stacktrace
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#if !_HAS_CXX23
#pragma message("The contents of <stacktrace> are available only with C++23 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <stacktrace> are available only with C++23 or later."))
#else // ^^^ !_HAS_CXX23 / _HAS_CXX23 vvv

#include <cstdint>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/stdatomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#endif // _M_CEE_PURE

#if !_HAS_CXX23
#pragma message("The contents of <stdatomic.h> are available only with C++23 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <stdatomic.h> are available only with C++23 or later."))
#else // ^^^ !_HAS_CXX23 / _HAS_CXX23 vvv

#include <atomic>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/stop_token
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#if !_HAS_CXX20
#pragma message("The contents of <stop_token> are available only with C++20 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <stop_token> are available only with C++20 or later."))
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv

#include <atomic>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/string_view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#if !_HAS_CXX17
#pragma message("The contents of <string_view> are available only with C++17 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <string_view> are available only with C++17 or later."))
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
#include <xstring>
#endif // _HAS_CXX17
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/syncstream
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include <yvals.h>
#if _STL_COMPILER_PREPROCESSOR
#if !_HAS_CXX20
#pragma message("The contents of <syncstream> are available only with C++20 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <syncstream> are available only with C++20 or later."))
#else // ^^^ !_HAS_CXX20 / _HAS_CXX20 vvv
#include <memory>
#include <ostream>
Expand Down
2 changes: 1 addition & 1 deletion stl/inc/variant
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#if _STL_COMPILER_PREPROCESSOR

#if !_HAS_CXX17
#pragma message("The contents of <variant> are available only with C++17 or later.")
#pragma message(_WARNING_MESSAGE("STL4038", "The contents of <variant> are available only with C++17 or later."))
#else // ^^^ !_HAS_CXX17 / _HAS_CXX17 vvv
#include <exception>
#include <initializer_list>
Expand Down
2 changes: 0 additions & 2 deletions stl/inc/yvals.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ _STL_DISABLE_CLANG_WARNINGS

#include <use_ansi.h>

#define _WARNING_MESSAGE(NUMBER, MESSAGE) __FILE__ "(" _CRT_STRINGIZE(__LINE__) "): warning " NUMBER ": " MESSAGE

#ifdef _STATIC_CPPLIB
#ifndef _DISABLE_DEPRECATE_STATIC_CPPLIB
#ifdef _DLL
Expand Down
8 changes: 7 additions & 1 deletion stl/inc/yvals_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@
#include <vcruntime.h>
#include <xkeycheck.h> // The _HAS_CXX tags must be defined before including this.

#define _WARNING_MESSAGE(NUMBER, MESSAGE) __FILE__ "(" _CRT_STRINGIZE(__LINE__) "): warning " NUMBER ": " MESSAGE

#ifndef _STL_WARNING_LEVEL
#if defined(_MSVC_WARNING_LEVEL) && _MSVC_WARNING_LEVEL >= 4
#define _STL_WARNING_LEVEL 4
Expand Down Expand Up @@ -1187,7 +1189,11 @@
#define _DEPRECATE_NONFLOATING_COMPLEX
#endif // ^^^ warning disabled ^^^

// next warning number: STL4038
// STL4038 is used to warn that "The contents of <meow> are available only with C++NN or later."

// STL4039 is used to warn that "The contents of <coroutine> are not available with /await."

// next warning number: STL4040

// P0619R4 Removing C++17-Deprecated Features
#ifndef _HAS_FEATURES_REMOVED_IN_CXX20
Expand Down