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

enable ubsan #3452

Merged
merged 22 commits into from
Mar 13, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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/regex
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ _STL_DISABLE_CLANG_WARNINGS

_STD_BEGIN

enum _Meta_type { // meta character representations for parser
enum _Meta_type : int { // meta character representations for parser
_Meta_lpar = '(',
_Meta_rpar = ')',
_Meta_dlr = '$',
Expand Down
8 changes: 4 additions & 4 deletions stl/inc/sstream
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ protected:

_Mysb::setp(_Newptr, _New_pnext, _Newptr + _Newsize);
if (_Mystate & _Noread) { // maintain eback() == allocated pointer invariant
_Mysb::setg(_Newptr, nullptr, _Newptr);
_Mysb::setg(_Newptr, _Newptr, _Newptr);
} else { // if readable, set the get area to initialized region
_Mysb::setg(_Newptr, _Newptr + (_Mysb::gptr() - _Oldptr), _Seekhigh);
}
Expand Down Expand Up @@ -440,7 +440,7 @@ protected:
_Mysb::setp(_Pnew, (_State & (_Atend | _Append)) ? _Seekhigh : _Pnew, _Seekhigh);

if (_State & _Noread) { // maintain "_Allocated == eback() points to buffer base" invariant
_Mysb::setg(_Pnew, nullptr, _Pnew);
_Mysb::setg(_Pnew, _Pnew, _Pnew);
}
}

Expand Down Expand Up @@ -469,7 +469,7 @@ protected:

_Mysb::setp(_Pnew, _Next, _End_buffer);
if (_State & _Noread) { // maintain "_Allocated == eback() points to buffer base" invariant
_Mysb::setg(_Pnew, nullptr, _Pnew);
_Mysb::setg(_Pnew, _Pnew, _Pnew);
} else {
_Mysb::setg(_Pnew, _Pnew, _Seekhigh);
}
Expand Down Expand Up @@ -521,7 +521,7 @@ private:

// TRANSITION, ABI, see GH-938
_Elem* _Seekhigh; // the high-water pointer in character array
int _Mystate; // the stream state
int _Mystate = 0; // the stream state
allocator_type _Al; // the allocator object
};

Expand Down
4 changes: 2 additions & 2 deletions tests/std/tests/char8_t_17_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ PM_CL="/BE /c /EHsc /MT /std:c++20 /permissive-"
PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MDd /std:c++17"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++latest /permissive- /fp:strict"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++latest /permissive- /fp:strict -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/char8_t_impure_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ PM_CL="/BE /c /EHsc /MT /std:c++20 /permissive-"
PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++14"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MDd /std:c++17"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++latest /permissive- /fp:strict"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++latest /permissive- /fp:strict -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/char8_t_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ PM_CL="/BE /c /EHsc /MT /std:c++20 /permissive- /w14640 /Zc:threadSafeInit-"
PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive- /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++14 /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MDd /std:c++17 /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive- /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++latest /permissive- /fp:strict /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++20 /permissive- /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++latest /permissive- /fp:strict /w14640 /Zc:threadSafeInit- -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/concepts_20_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ PM_CL="/clr /MD /std:c++20 /d1clrcxxstd"
PM_CL="/clr /MDd /std:c++20 /d1clrcxxstd"
# PM_CL="/std:c++20 /permissive- /BE /c /EHsc /MD"
# PM_CL="/std:c++latest /permissive- /BE /c /EHsc /MTd"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++20 /permissive- /MD"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++latest /permissive- /MTd /fp:strict"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++20 /permissive- /MDd"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++latest /permissive- /MT /fp:strict -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/concepts_latest_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ PM_CL="/MTd /D_ITERATOR_DEBUG_LEVEL=2 /permissive"
PM_CL="/MTd /D_ITERATOR_DEBUG_LEVEL=2 /permissive- /analyze:only /analyze:autolog-"
# PM_CL="/permissive- /BE /c /MD"
# PM_CL="/permissive- /BE /c /MTd"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /permissive- /MD"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /permissive- /MTd /fp:strict"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /permissive- /MDd"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /permissive- /MT /fp:strict -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/impure_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ PM_CL="/BE /c /EHsc /MT /std:c++20 /permissive-"
PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++14"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MDd /std:c++17"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++latest /permissive- /fp:strict"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++latest /permissive- /fp:strict -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/locale0_implib_cpp_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ PM_CL="/BE /c /EHsc /MT /std:c++20 /permissive- /w14640 /Zc:threadSafeInit-"
PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive- /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++14 /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MDd /std:c++17 /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive- /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++latest /permissive- /fp:strict /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++20 /permissive- /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++latest /permissive- /fp:strict /w14640 /Zc:threadSafeInit- -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/strict_concepts_20_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ PM_CL="/clr /MD /std:c++20 /d1clrcxxstd"
PM_CL="/clr /MDd /std:c++20 /d1clrcxxstd"
# PM_CL="/std:c++20 /BE /c /EHsc /MD"
# PM_CL="/std:c++latest /BE /c /EHsc /MTd"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++20 /MD"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++latest /MTd /fp:strict"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++20 /MDd"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++latest /MT /fp:strict -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/strict_concepts_latest_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ PM_CL="/MTd /D_ITERATOR_DEBUG_LEVEL=2"
PM_CL="/MTd /D_ITERATOR_DEBUG_LEVEL=2 /analyze:only /analyze:autolog-"
# PM_CL="/BE /c /MD"
# PM_CL="/BE /c /MTd"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /MD"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /MTd /fp:strict"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /MDd"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /MT /fp:strict -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/usual_17_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ PM_CL="/BE /c /EHsc /MT /std:c++20 /permissive-"
PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MDd /std:c++17"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++latest /permissive- /fp:strict"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++latest /permissive- /fp:strict -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/usual_20_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ PM_CL="/clr /MD /std:c++20 /d1clrcxxstd"
PM_CL="/clr /MDd /std:c++20 /d1clrcxxstd"
PM_CL="/BE /c /EHsc /MD /std:c++20 /permissive-"
PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++20 /permissive- /MD"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++latest /permissive- /MTd /fp:strict"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++20 /permissive- /MDd"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /std:c++latest /permissive- /MT /fp:strict -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/usual_latest_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ PM_CL="/MTd /D_ITERATOR_DEBUG_LEVEL=2 /permissive"
PM_CL="/MTd /D_ITERATOR_DEBUG_LEVEL=2 /permissive- /analyze:only /analyze:autolog-"
PM_CL="/BE /c /MD /permissive-"
PM_CL="/BE /c /MTd /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /permissive- /MD"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /permissive- /MTd /fp:strict"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /permissive- /MDd"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /permissive- /MT /fp:strict -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/std/tests/usual_matrix.lst
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ PM_CL="/BE /c /EHsc /MT /std:c++20 /permissive- /w14640 /Zc:threadSafeInit-"
PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive- /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MD /std:c++14 /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MDd /std:c++17 /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++20 /permissive- /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++latest /permissive- /fp:strict /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MTd /std:c++20 /permissive- /w14640 /Zc:threadSafeInit-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call /EHsc /MT /std:c++latest /permissive- /fp:strict /w14640 /Zc:threadSafeInit- -fsanitize=undefined -fno-sanitize-recover=undefined"
4 changes: 2 additions & 2 deletions tests/tr1/env.lst
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ PM_CL="/BE /c /EHsc /MT /std:c++20 /permissive-"
PM_CL="/BE /c /EHsc /MTd /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Xclang -Wno-deprecated-declarations -Xclang -Wno-self-assign /EHsc /MD /std:c++14"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Xclang -Wno-deprecated-declarations -Xclang -Wno-self-assign /EHsc /MDd /std:c++17"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Xclang -Wno-deprecated-declarations -Xclang -Wno-self-assign /EHsc /MT /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Xclang -Wno-deprecated-declarations -Xclang -Wno-self-assign /EHsc /MTd /std:c++latest /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Xclang -Wno-deprecated-declarations -Xclang -Wno-self-assign /EHsc /MTd /std:c++20 /permissive-"
PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing -Wno-unqualified-std-cast-call -Xclang -Wno-deprecated-declarations -Xclang -Wno-self-assign /EHsc /MT /std:c++latest /permissive- -fsanitize=undefined -fno-sanitize-recover=undefined"
6 changes: 2 additions & 4 deletions tests/tr1/tests/cstddef/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,14 @@ typedef struct {
} Str;

void test_cpp() { // test C++ header
ptrdiff_t zero = 0;
static char* pc = (char*) zero;
static const STDx size_t offs[] = {offsetof(Str, f1), offsetof(Str, f2), offsetof(Str, f3)};
STDx ptrdiff_t pdiff = &pc[INT_MAX] - &pc[0];
wchar_t wc = L'Z';
Str x = {1, {2}, 3};
char* ps = (char*) &x;
STDx ptrdiff_t pdiff = &ps[INT_MAX] - &ps[0];
fsb4000 marked this conversation as resolved.
Show resolved Hide resolved

CHECK_INT(sizeof(STDx size_t), sizeof(sizeof(char)));
CHECK_INT(pdiff, &pc[INT_MAX] - &pc[0]);
CHECK_INT(pdiff, &ps[INT_MAX] - &ps[0]);
CHECK_INT(wc, L'Z');
CHECK(offs[0] < offs[1]);
CHECK_INT((long) *(float*) (ps + offs[1]), 2);
Expand Down
2 changes: 1 addition & 1 deletion tests/tr1/tests/type_traits5/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static void t_add_rvalue_reference() { // test add_rvalue_reference<T> for vario
CHECK_TYPEX(STD add_rvalue_reference<ARR1>::type, ARR1 &&);
}

typedef enum { red, blue, green } color;
typedef enum color : int { red, blue, green } color;
StephanTLavavej marked this conversation as resolved.
Show resolved Hide resolved

static void t_make_signed() { // test make_signed<T> for various types
CHECK_TYPE(STD make_signed<signed char>::type, signed char);
Expand Down