Skip to content

Commit df21344

Browse files
1 parent 45e5d45 commit df21344

7 files changed

Lines changed: 285 additions & 6 deletions

File tree

stl/inc/__msvc_sanitizer_annotate_container.hpp

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ _STL_DISABLE_CLANG_WARNINGS
2020
// (this will be auto-defined on unsupported platforms)
2121
// + _DISABLE_STRING_ANNOTATION: same, but for only `basic_string`
2222
// + _DISABLE_VECTOR_ANNOTATION: same, but for only `vector`
23+
// + _DISABLE_OPTIONAL_ANNOTATION: same, but for only `optional`
2324
// - _ENABLE_STL_ANNOTATION_ON_UNSUPPORTED_PLATFORMS: Don't auto-disable ASan annotations
2425
// - _ANNOTATE_STL: Even when ASan annotations are disabled, insert the code for annotating into the STL anyways;
2526
// this is useful when building static libraries which may be linked against both ASan and non-ASan binaries.
2627
// + _ANNOTATE_STRING: same, but only for `basic_string`
2728
// + _ANNOTATE_VECTOR: same, but only for `vector`
29+
// + _ANNOTATE_OPTIONAL: same, but only for `optional`
2830

2931
#if !defined(_DISABLE_STL_ANNOTATION) && !defined(_ENABLE_STL_ANNOTATION_ON_UNSUPPORTED_PLATFORMS)
3032

@@ -46,6 +48,9 @@ _STL_DISABLE_CLANG_WARNINGS
4648
#ifndef _DISABLE_VECTOR_ANNOTATION
4749
#define _DISABLE_VECTOR_ANNOTATION
4850
#endif // ^^^ !defined(_DISABLE_VECTOR_ANNOTATION) ^^^
51+
#ifndef _DISABLE_OPTIONAL_ANNOTATION
52+
#define _DISABLE_OPTIONAL_ANNOTATION
53+
#endif // ^^^ !defined(_DISABLE_OPTIONAL_ANNOTATION) ^^^
4954

5055
#endif // ^^^ defined(_DISABLE_STL_ANNOTATION) ^^^
5156

@@ -59,6 +64,10 @@ _STL_DISABLE_CLANG_WARNINGS
5964
#define _ANNOTATE_VECTOR
6065
#endif // ^^^ !defined(_ANNOTATE_VECTOR) ^^^
6166

67+
#ifndef _ANNOTATE_OPTIONAL
68+
#define _ANNOTATE_OPTIONAL
69+
#endif // ^^^ !defined(_ANNOTATE_OPTIONAL) ^^^
70+
6271
#endif // ^^^ defined(_ANNOTATE_STL) ^^^
6372

6473
#ifdef __SANITIZE_ADDRESS__
@@ -67,6 +76,8 @@ _STL_DISABLE_CLANG_WARNINGS
6776
#define _INSERT_STRING_ANNOTATION
6877
#define _ACTIVATE_VECTOR_ANNOTATION
6978
#define _INSERT_VECTOR_ANNOTATION
79+
#define _ACTIVATE_OPTIONAL_ANNOTATION
80+
#define _INSERT_OPTIONAL_ANNOTATION
7081

7182
#elif defined(__clang__) // ^^^ defined(__SANITIZE_ADDRESS__) / defined(__clang__) vvv
7283

@@ -75,6 +86,8 @@ _STL_DISABLE_CLANG_WARNINGS
7586
#define _INSERT_STRING_ANNOTATION
7687
#define _ACTIVATE_VECTOR_ANNOTATION
7788
#define _INSERT_VECTOR_ANNOTATION
89+
#define _ACTIVATE_OPTIONAL_ANNOTATION
90+
#define _INSERT_OPTIONAL_ANNOTATION
7891
#pragma comment(linker, "/INFERASANLIBS")
7992
#endif // __has_feature(address_sanitizer)
8093

@@ -89,13 +102,20 @@ _STL_DISABLE_CLANG_WARNINGS
89102
#undef _ACTIVATE_VECTOR_ANNOTATION
90103
#undef _INSERT_VECTOR_ANNOTATION
91104
#endif // ^^^ defined(_DISABLE_VECTOR_ANNOTATION) ^^^
105+
#ifdef _DISABLE_OPTIONAL_ANNOTATION
106+
#undef _ACTIVATE_OPTIONAL_ANNOTATION
107+
#undef _INSERT_OPTIONAL_ANNOTATION
108+
#endif // ^^^ defined(_DISABLE_OPTIONAL_ANNOTATION) ^^^
92109

93110
#ifdef _ANNOTATE_STRING
94111
#define _INSERT_STRING_ANNOTATION
95112
#endif // ^^^ defined(_ANNOTATE_STRING) ^^^
96113
#ifdef _ANNOTATE_VECTOR
97114
#define _INSERT_VECTOR_ANNOTATION
98115
#endif // ^^^ defined(_ANNOTATE_VECTOR) ^^^
116+
#ifdef _ANNOTATE_OPTIONAL
117+
#define _INSERT_OPTIONAL_ANNOTATION
118+
#endif // ^^^ defined(_ANNOTATE_OPTIONAL) ^^^
99119

100120

101121
#ifndef _INSERT_STRING_ANNOTATION
@@ -104,6 +124,9 @@ _STL_DISABLE_CLANG_WARNINGS
104124
#ifndef _INSERT_VECTOR_ANNOTATION
105125
#pragma detect_mismatch("annotate_vector", "0")
106126
#endif // ^^^ !defined(_INSERT_VECTOR_ANNOTATION) ^^^
127+
#ifndef _INSERT_OPTIONAL_ANNOTATION
128+
#pragma detect_mismatch("annotate_optional", "0")
129+
#endif // ^^^ !defined(_INSERT_OPTIONAL_ANNOTATION) ^^^
107130

108131
#ifdef _ACTIVATE_STRING_ANNOTATION
109132
#pragma comment(lib, "stl_asan")
@@ -113,9 +136,14 @@ _STL_DISABLE_CLANG_WARNINGS
113136
#pragma comment(lib, "stl_asan")
114137
#pragma detect_mismatch("annotate_vector", "1")
115138
#endif // ^^^ defined(_ACTIVATE_VECTOR_ANNOTATION) ^^^
139+
#ifdef _ACTIVATE_OPTIONAL_ANNOTATION
140+
#pragma comment(lib, "stl_asan")
141+
#pragma detect_mismatch("annotate_optional", "1")
142+
#endif // ^^^ defined(_ACTIVATE_OPTIONAL_ANNOTATION) ^^^
116143

117144
#undef _ACTIVATE_STRING_ANNOTATION
118145
#undef _ACTIVATE_VECTOR_ANNOTATION
146+
#undef _ACTIVATE_OPTIONAL_ANNOTATION
119147

120148
extern "C" {
121149
#ifdef _INSERT_VECTOR_ANNOTATION
@@ -125,16 +153,27 @@ extern const bool _Asan_vector_should_annotate;
125153
#ifdef _INSERT_STRING_ANNOTATION
126154
extern const bool _Asan_string_should_annotate;
127155
#endif
156+
157+
#ifdef _INSERT_OPTIONAL_ANNOTATION
158+
extern const bool _Asan_optional_should_annotate;
159+
#endif
128160
} // extern "C"
129161

130-
#if defined(_INSERT_VECTOR_ANNOTATION) || defined(_INSERT_STRING_ANNOTATION)
162+
#if defined(_INSERT_VECTOR_ANNOTATION) || defined(_INSERT_STRING_ANNOTATION) || defined(_INSERT_OPTIONAL_ANNOTATION)
131163
extern "C" {
164+
void __cdecl __asan_poison_memory_region(const volatile void* _Addr, size_t _Size);
165+
void __cdecl __asan_unpoison_memory_region(const volatile void* _Addr, size_t _Size);
166+
132167
// This must match ASan's primary declaration, which isn't marked `noexcept`.
133168
void __cdecl __sanitizer_annotate_contiguous_container(
134169
const void* _First, const void* _End, const void* _Old_last, const void* _New_last);
135170
} // extern "C"
136171

137172
#ifdef _M_ARM64EC
173+
#pragma comment(linker, "/alternatename:#__asan_poison_memory_region=#__asan_poison_memory_region_default")
174+
#pragma comment(linker, "/alternatename:__asan_poison_memory_region=__asan_poison_memory_region_default")
175+
#pragma comment(linker, "/alternatename:#__asan_unpoison_memory_region=#__asan_unpoison_memory_region_default")
176+
#pragma comment(linker, "/alternatename:__asan_unpoison_memory_region=__asan_unpoison_memory_region_default")
138177
#pragma comment(linker, \
139178
"/alternatename:#__sanitizer_annotate_contiguous_container=#__sanitizer_annotate_contiguous_container_default")
140179
#pragma comment(linker, \
@@ -143,7 +182,13 @@ void __cdecl __sanitizer_annotate_contiguous_container(
143182
#pragma comment(linker, "/alternatename:_Asan_vector_should_annotate=_Asan_vector_should_annotate_default")
144183
#pragma comment(linker, "/alternatename:#_Asan_string_should_annotate=#_Asan_string_should_annotate_default")
145184
#pragma comment(linker, "/alternatename:_Asan_string_should_annotate=_Asan_string_should_annotate_default")
185+
#pragma comment(linker, "/alternatename:#_Asan_optional_should_annotate=#_Asan_optional_should_annotate_default")
186+
#pragma comment(linker, "/alternatename:_Asan_optional_should_annotate=_Asan_optional_should_annotate_default")
146187
#elif defined(_M_HYBRID)
188+
#pragma comment(linker, "/alternatename:#__asan_poison_memory_region=#__asan_poison_memory_region_default")
189+
#pragma comment(linker, "/alternatename:___asan_poison_memory_region=___asan_poison_memory_region_default")
190+
#pragma comment(linker, "/alternatename:#__asan_unpoison_memory_region=#__asan_unpoison_memory_region_default")
191+
#pragma comment(linker, "/alternatename:___asan_unpoison_memory_region=___asan_unpoison_memory_region_default")
147192
#pragma comment(linker, \
148193
"/alternatename:#__sanitizer_annotate_contiguous_container=#__sanitizer_annotate_contiguous_container_default")
149194
#pragma comment(linker, \
@@ -152,16 +197,24 @@ void __cdecl __sanitizer_annotate_contiguous_container(
152197
#pragma comment(linker, "/alternatename:__Asan_vector_should_annotate=__Asan_vector_should_annotate_default")
153198
#pragma comment(linker, "/alternatename:#_Asan_string_should_annotate=#_Asan_string_should_annotate_default")
154199
#pragma comment(linker, "/alternatename:__Asan_string_should_annotate=__Asan_string_should_annotate_default")
200+
#pragma comment(linker, "/alternatename:#_Asan_optional_should_annotate=#_Asan_optional_should_annotate_default")
201+
#pragma comment(linker, "/alternatename:__Asan_optional_should_annotate=__Asan_optional_should_annotate_default")
155202
#elif defined(_M_IX86)
203+
#pragma comment(linker, "/alternatename:___asan_poison_memory_region=___asan_poison_memory_region_default")
204+
#pragma comment(linker, "/alternatename:___asan_unpoison_memory_region=___asan_unpoison_memory_region_default")
156205
#pragma comment(linker, \
157206
"/alternatename:___sanitizer_annotate_contiguous_container=___sanitizer_annotate_contiguous_container_default")
158207
#pragma comment(linker, "/alternatename:__Asan_vector_should_annotate=__Asan_vector_should_annotate_default")
159208
#pragma comment(linker, "/alternatename:__Asan_string_should_annotate=__Asan_string_should_annotate_default")
209+
#pragma comment(linker, "/alternatename:__Asan_optional_should_annotate=__Asan_optional_should_annotate_default")
160210
#elif defined(_M_X64) || defined(_M_ARM64)
211+
#pragma comment(linker, "/alternatename:__asan_poison_memory_region=__asan_poison_memory_region_default")
212+
#pragma comment(linker, "/alternatename:__asan_unpoison_memory_region=__asan_unpoison_memory_region_default")
161213
#pragma comment(linker, \
162214
"/alternatename:__sanitizer_annotate_contiguous_container=__sanitizer_annotate_contiguous_container_default")
163215
#pragma comment(linker, "/alternatename:_Asan_vector_should_annotate=_Asan_vector_should_annotate_default")
164216
#pragma comment(linker, "/alternatename:_Asan_string_should_annotate=_Asan_string_should_annotate_default")
217+
#pragma comment(linker, "/alternatename:_Asan_optional_should_annotate=_Asan_optional_should_annotate_default")
165218
#else // ^^^ known architecture / unknown architecture vvv
166219
#error Unknown architecture
167220
#endif // ^^^ unknown architecture ^^^

stl/inc/optional

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ _EMIT_STL_WARNING(STL4038, "The contents of <optional> are available only with C
1313
#if _HAS_CXX20
1414
#include <compare>
1515
#endif // _HAS_CXX20
16+
#include <__msvc_sanitizer_annotate_container.hpp>
1617
#include <exception>
1718
#include <initializer_list>
1819
#include <type_traits>
@@ -90,6 +91,7 @@ struct _Optional_destruct_base { // either contains a value of _Ty or is empty (
9091

9192
// For the trivially destructible case, we can't add a destructor for _MSVC_STL_DESTRUCTOR_TOMBSTONES, due to
9293
// N5001 [optional.dtor]/2: "Remarks: If is_trivially_destructible_v<T> is true, then this destructor is trivial."
94+
// This also prevents ASan annotations from being used.
9395

9496
_CONSTEXPR20 void reset() noexcept {
9597
_Has_value = false;
@@ -114,10 +116,25 @@ struct _Optional_destruct_base<_Ty, false> { // either contains a value of _Ty o
114116
// and we don't know whether the object has an invalid representation, much less what it could be.
115117
_Has_value = false;
116118
#endif
119+
} else {
120+
#ifdef _INSERT_OPTIONAL_ANNOTATION
121+
// Unpoison our storage when the std::optional is destroyed.
122+
// We're giving up control of these bytes, which can be validly reused for something else.
123+
if (!_STD _Is_constant_evaluated() && _Asan_optional_should_annotate) {
124+
__asan_unpoison_memory_region(_STD addressof(_Value), sizeof(_Ty));
125+
}
126+
#endif // ^^^ defined(_INSERT_OPTIONAL_ANNOTATION) ^^^
117127
}
118128
}
119129

120-
constexpr _Optional_destruct_base() noexcept : _Dummy{}, _Has_value{false} {} // initialize an empty optional
130+
constexpr _Optional_destruct_base() noexcept : _Dummy{}, _Has_value{false} { // initialize an empty optional
131+
#ifdef _INSERT_OPTIONAL_ANNOTATION
132+
// Poison our storage when starting empty, until that changes or the std::optional is destroyed.
133+
if (!_STD _Is_constant_evaluated() && _Asan_optional_should_annotate) {
134+
__asan_poison_memory_region(_STD addressof(_Value), sizeof(_Ty));
135+
}
136+
#endif // ^^^ defined(_INSERT_OPTIONAL_ANNOTATION) ^^^
137+
}
121138

122139
template <class... _Types>
123140
constexpr explicit _Optional_destruct_base(in_place_t, _Types&&... _Args)
@@ -140,6 +157,13 @@ struct _Optional_destruct_base<_Ty, false> { // either contains a value of _Ty o
140157
if (_Has_value) {
141158
_Value.~_Ty();
142159
_Has_value = false;
160+
161+
#ifdef _INSERT_OPTIONAL_ANNOTATION
162+
// Poison our storage when becoming empty, until that changes or the std::optional is destroyed.
163+
if (!_STD _Is_constant_evaluated() && _Asan_optional_should_annotate) {
164+
__asan_poison_memory_region(_STD addressof(_Value), sizeof(_Ty));
165+
}
166+
#endif // ^^^ defined(_INSERT_OPTIONAL_ANNOTATION) ^^^
143167
}
144168
}
145169
};
@@ -153,6 +177,17 @@ struct _Optional_construct_base : _Optional_destruct_base<_Ty> {
153177
_CONSTEXPR20 _Ty& _Construct(_Types&&... _Args) noexcept(is_nothrow_constructible_v<_Ty, _Types...>) {
154178
// transition from the empty to the value-containing state
155179
_STL_INTERNAL_CHECK(!this->_Has_value);
180+
181+
#ifdef _INSERT_OPTIONAL_ANNOTATION
182+
// Only the non-trivially destructible case can use ASan annotations, as the destructor is needed to undo them.
183+
if constexpr (!is_trivially_destructible_v<_Ty>) {
184+
// Unpoison our storage when becoming non-empty.
185+
if (!_STD _Is_constant_evaluated() && _Asan_optional_should_annotate) {
186+
__asan_unpoison_memory_region(_STD addressof(this->_Value), sizeof(_Ty));
187+
}
188+
}
189+
#endif // ^^^ defined(_INSERT_OPTIONAL_ANNOTATION) ^^^
190+
156191
_STD _Construct_in_place(this->_Value, _STD forward<_Types>(_Args)...);
157192
this->_Has_value = true;
158193
return this->_Value;

stl/src/asan.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33

44
namespace std {
55
extern "C" {
6-
extern const bool _Asan_string_should_annotate = true;
7-
extern const bool _Asan_vector_should_annotate = true;
6+
extern const bool _Asan_string_should_annotate = true;
7+
extern const bool _Asan_vector_should_annotate = true;
8+
extern const bool _Asan_optional_should_annotate = true;
89
} // extern "C"
910
} // namespace std

stl/src/asan_noop.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,12 @@
22
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

44
extern "C" {
5-
extern const bool _Asan_string_should_annotate_default = false;
6-
extern const bool _Asan_vector_should_annotate_default = false;
5+
extern const bool _Asan_string_should_annotate_default = false;
6+
extern const bool _Asan_vector_should_annotate_default = false;
7+
extern const bool _Asan_optional_should_annotate_default = false;
8+
9+
void __cdecl __asan_poison_memory_region_default(const volatile void*, size_t) {}
10+
void __cdecl __asan_unpoison_memory_region_default(const volatile void*, size_t) {}
711

812
void __cdecl __sanitizer_annotate_contiguous_container_default(
913
const void*, const void*, const void*, const void*) noexcept {}

tests/std/test.lst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ tests\GH_005780_non_ascii_locales
281281
tests\GH_005800_stable_sort_large_alignment
282282
tests\GH_005816_numeric_limits_traps
283283
tests\GH_005968_headers_provide_begin_end
284+
tests\GH_005974_asan_annotate_optional
284285
tests\LWG2381_num_get_floating_point
285286
tests\LWG2510_tag_classes
286287
tests\LWG2597_complex_branch_cut
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright (c) Microsoft Corporation.
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
# This test matrix was derived from usual_17_matrix.lst with the same elaborate transformations
5+
# that were used to derive GH_002030_asan_annotate_vector/env.lst from usual_matrix.lst.
6+
7+
# TRANSITION, google/sanitizers#328: clang-cl does not support /MDd or /MTd with ASan
8+
RUNALL_INCLUDE ..\prefix.lst
9+
RUNALL_CROSSLIST
10+
PM_CL="/Zi /wd4611 /w14640 /Zc:threadSafeInit-" PM_LINK="/debug"
11+
RUNALL_CROSSLIST
12+
PM_CL="-fsanitize=address /BE /c /EHsc /MD /std:c++latest /permissive-"
13+
PM_CL="-fsanitize=address /BE /c /EHsc /MDd /std:c++17 /permissive-"
14+
PM_CL="-fsanitize=address /BE /c /EHsc /MT /std:c++20 /permissive-"
15+
PM_CL="-fsanitize=address /BE /c /EHsc /MTd /std:c++latest /permissive-"
16+
PM_CL="-fsanitize=address /EHsc /MD /std:c++17"
17+
PM_CL="-fsanitize=address /EHsc /MD /std:c++20"
18+
PM_CL="-fsanitize=address /EHsc /MD /std:c++latest /permissive- /Zc:char8_t- /Zc:preprocessor"
19+
PM_CL="-fsanitize=address /EHsc /MD /std:c++latest /permissive- /Zc:noexceptTypes-"
20+
PM_CL="-fsanitize=address /EHsc /MD /std:c++latest /permissive-"
21+
PM_CL="-fsanitize=address /EHsc /MDd /std:c++17 /permissive-"
22+
PM_CL="-fsanitize=address /EHsc /MDd /std:c++20 /permissive-"
23+
PM_CL="-fsanitize=address /EHsc /MDd /std:c++latest /permissive- /fp:except /Zc:preprocessor"
24+
PM_CL="-fsanitize=address /EHsc /MDd /std:c++latest /permissive- /Zc:wchar_t-"
25+
PM_CL="-fsanitize=address /EHsc /MDd /std:c++latest /permissive-"
26+
PM_CL="-fsanitize=address /EHsc /MT /std:c++latest /permissive- /analyze:only /analyze:autolog-"
27+
PM_CL="-fsanitize=address /EHsc /MT /std:c++latest /permissive-"
28+
PM_CL="-fsanitize=address /EHsc /MTd /std:c++latest /permissive"
29+
PM_CL="-fsanitize=address /EHsc /MTd /std:c++latest /permissive- /analyze:only /analyze:autolog-"
30+
PM_CL="-fsanitize=address /EHsc /MTd /std:c++latest /permissive- /fp:strict"
31+
PM_CL="-fsanitize=address /EHsc /MTd /std:c++latest /permissive-"
32+
PM_CL="/D_ANNOTATE_OPTIONAL /BE /c /EHsc /MD /std:c++latest /permissive-"
33+
PM_CL="/D_ANNOTATE_OPTIONAL /BE /c /EHsc /MDd /std:c++17 /permissive-"
34+
PM_CL="/D_ANNOTATE_OPTIONAL /BE /c /EHsc /MT /std:c++20 /permissive-"
35+
PM_CL="/D_ANNOTATE_OPTIONAL /BE /c /EHsc /MTd /std:c++latest /permissive-"
36+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MD /std:c++17"
37+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MD /std:c++20"
38+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MD /std:c++latest /permissive- /Zc:char8_t- /Zc:preprocessor"
39+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MD /std:c++latest /permissive- /Zc:noexceptTypes-"
40+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MD /std:c++latest /permissive-"
41+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MDd /std:c++17 /permissive-"
42+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MDd /std:c++20 /permissive-"
43+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MDd /std:c++latest /permissive- /fp:except /Zc:preprocessor"
44+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MDd /std:c++latest /permissive- /Zc:wchar_t-"
45+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MDd /std:c++latest /permissive-"
46+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MT /std:c++latest /permissive- /analyze:only /analyze:autolog-"
47+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MT /std:c++latest /permissive-"
48+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MTd /std:c++latest /permissive"
49+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MTd /std:c++latest /permissive- /analyze:only /analyze:autolog-"
50+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MTd /std:c++latest /permissive- /fp:strict"
51+
PM_CL="/D_ANNOTATE_OPTIONAL /EHsc /MTd /std:c++latest /permissive-"
52+
# TRANSITION, we don't use /ALTERNATENAME for Clang (see GH-5224) so we cannot test /D_ANNOTATE_OPTIONAL without -fsanitize=address
53+
PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++latest /permissive-"
54+
PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++17"
55+
PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive-"
56+
PM_COMPILER="clang-cl" PM_CL="-fsanitize=address -fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++latest /permissive- /fp:strict"

0 commit comments

Comments
 (0)