-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Changes to support the compiler portion of P1152R4 "deprecating volatile" #674
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
Changes from all commits
624e11b
afd3312
fecea71
f0ac48c
26cb32e
b4095f9
99a51a1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1660,13 +1660,14 @@ struct _Invoker_ret<_Unforced, false> { // selected for _Rx being _Unforced | |
|
|
||
|
|
||
| // TYPE TRAITS FOR invoke() | ||
| template <class _To> | ||
| void _Implicitly_convert_to(_To) noexcept; // not defined | ||
|
|
||
| #pragma warning(push) | ||
| #pragma warning(disable : 4242) // 'identifier': conversion from '_From' to '_To', possible loss of data (/Wall) | ||
| #pragma warning(disable : 4244) // 'argument': conversion from '_From' to '_To', possible loss of data | ||
| #pragma warning(disable : 4365) // 'argument': conversion from '_From' to '_To', signed/unsigned mismatch (/Wall) | ||
| #pragma warning(disable : 5215) // '%s' a function parameter with a volatile qualified type is deprecated in C++20 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find it somewhat interesting that you don't need to suppress Clang
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We probably should; this will be in some future set of "suppress clang warnings that don't show up because system header" 🤷♂ . |
||
| template <class _To> | ||
| void _Implicitly_convert_to(_To) noexcept; // not defined | ||
|
|
||
| template <class _From, class _To, bool = is_convertible_v<_From, _To>, bool = is_void_v<_To>> | ||
| _INLINE_VAR constexpr bool _Is_nothrow_convertible_v = noexcept(_Implicitly_convert_to<_To>(_STD declval<_From>())); | ||
| #pragma warning(pop) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| PM_CL="/nologo /Od /W4 /w14061 /w14242 /w14582 /w14583 /w14587 /w14588 /w14265 /w14749 /w14841 /w14842 /w15038 /wd4643 /sdl /WX /Zc:strictStrings /D_ENABLE_STL_INTERNAL_CHECK /bigobj /FImsvc_stdlib_force_include.h /permissive-" | ||
| PM_CL="/nologo /Od /W4 /w14061 /w14242 /w14265 /w14582 /w14583 /w14587 /w14588 /wd4643 /w14749 /w14841 /w14842 /w15038 /w15214 /w15215 /w15216 /w15217 /sdl /WX /Zc:strictStrings /D_ENABLE_STL_INTERNAL_CHECK /bigobj /FImsvc_stdlib_force_include.h /permissive-" | ||
| RUNALL_CROSSLIST | ||
| PM_CL="/EHsc /MTd /D_ITERATOR_DEBUG_LEVEL=2 /std:c++latest /analyze" | ||
| PM_COMPILER="clang-cl" PM_CL="-fno-ms-compatibility -fno-delayed-template-parsing /EHsc /MTd /std:c++latest" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| # Copyright (c) Microsoft Corporation. | ||
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
|
||
| PM_CL="/nologo /Od /W4 /w14061 /w14242 /w14582 /w14583 /w14587 /w14588 /w14265 /w14365 /w14749 /w14841 /w14842 /w15038 /sdl /WX /Zc:strictStrings /D_ENABLE_STL_INTERNAL_CHECK /D_ENFORCE_FACET_SPECIALIZATIONS=1 /bigobj" | ||
| PM_CL="/nologo /Od /W4 /w14061 /w14242 /w14265 /w14365 /w14582 /w14583 /w14587 /w14588 /w14749 /w14841 /w14842 /w15038 /w15214 /w15215 /w15216 /w15217 /sdl /WX /Zc:strictStrings /D_ENABLE_STL_INTERNAL_CHECK /D_ENFORCE_FACET_SPECIALIZATIONS=1 /bigobj" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,9 @@ | |
|
|
||
| // common header for functional?.cpp | ||
|
|
||
| #pragma warning(push) | ||
| #pragma warning(disable : 5215) // '%s' a function parameter with volatile qualified type is deprecated in C++20 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The warning push/disable/pop is the only functional change to this header; I made a non-functional drive-by fix to some weird formatting on lines 135-220. |
||
|
|
||
| struct funobj; | ||
| static int f0(); | ||
| static int f1(const volatile funobj); | ||
|
|
@@ -131,20 +134,19 @@ struct funobj { // general purpose function object | |
| int cf6(int i1, int i2, int i3, int i4, int i5) const { // const member function with five arguments | ||
| return ::f6(*this, i1, i2, i3, i4, i5); | ||
| } | ||
| int cf7(int i1, int i2, int i3, int i4, int i5, | ||
| int i6) const { // const member function with six arguments | ||
| int cf7(int i1, int i2, int i3, int i4, int i5, int i6) const { // const member function with six arguments | ||
| return ::f7(*this, i1, i2, i3, i4, i5, i6); | ||
| } | ||
| int cf8( | ||
| int i1, int i2, int i3, int i4, int i5, int i6, int i7) const { // const member function with seven arguments | ||
| int cf8(int i1, int i2, int i3, int i4, int i5, int i6, int i7) const { | ||
| // const member function with seven arguments | ||
| return ::f8(*this, i1, i2, i3, i4, i5, i6, i7); | ||
| } | ||
| int cf9(int i1, int i2, int i3, int i4, int i5, int i6, int i7, | ||
| int i8) const { // const member function with eight arguments | ||
| int cf9(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8) const { | ||
| // const member function with eight arguments | ||
| return ::f9(*this, i1, i2, i3, i4, i5, i6, i7, i8); | ||
| } | ||
| int cf10(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, | ||
| int i9) const { // const member function with nine arguments | ||
| int cf10(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9) const { | ||
| // const member function with nine arguments | ||
| return ::f10(*this, i1, i2, i3, i4, i5, i6, i7, i8, i9); | ||
| } | ||
|
|
||
|
|
@@ -166,20 +168,19 @@ struct funobj { // general purpose function object | |
| int vf6(int i1, int i2, int i3, int i4, int i5) volatile { // volatile member function with five arguments | ||
| return ::f6(*this, i1, i2, i3, i4, i5); | ||
| } | ||
| int vf7(int i1, int i2, int i3, int i4, int i5, | ||
| int i6) volatile { // volatile member function with six arguments | ||
| int vf7(int i1, int i2, int i3, int i4, int i5, int i6) volatile { // volatile member function with six arguments | ||
| return ::f7(*this, i1, i2, i3, i4, i5, i6); | ||
| } | ||
| int vf8(int i1, int i2, int i3, int i4, int i5, int i6, | ||
| int i7) volatile { // volatile member function with seven arguments | ||
| int vf8(int i1, int i2, int i3, int i4, int i5, int i6, int i7) volatile { | ||
| // volatile member function with seven arguments | ||
| return ::f8(*this, i1, i2, i3, i4, i5, i6, i7); | ||
| } | ||
| int vf9(int i1, int i2, int i3, int i4, int i5, int i6, int i7, | ||
| int i8) volatile { // volatile member function with eight arguments | ||
| int vf9(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8) volatile { | ||
| // volatile member function with eight arguments | ||
| return ::f9(*this, i1, i2, i3, i4, i5, i6, i7, i8); | ||
| } | ||
| int vf10(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, | ||
| int i9) volatile { // volatile member function with nine arguments | ||
| int vf10(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9) volatile { | ||
| // volatile member function with nine arguments | ||
| return ::f10(*this, i1, i2, i3, i4, i5, i6, i7, i8, i9); | ||
| } | ||
|
|
||
|
|
@@ -198,24 +199,24 @@ struct funobj { // general purpose function object | |
| int cvf5(int i1, int i2, int i3, int i4) const volatile { // const volatile member function with four arguments | ||
| return ::f5(*this, i1, i2, i3, i4); | ||
| } | ||
| int cvf6(int i1, int i2, int i3, int i4, int i5) const | ||
| volatile { // const volatile member function with five arguments | ||
| int cvf6(int i1, int i2, int i3, int i4, int i5) const volatile { | ||
| // const volatile member function with five arguments | ||
| return ::f6(*this, i1, i2, i3, i4, i5); | ||
| } | ||
| int cvf7(int i1, int i2, int i3, int i4, int i5, | ||
| int i6) const volatile { // const volatile member function with six arguments | ||
| int cvf7(int i1, int i2, int i3, int i4, int i5, int i6) const volatile { | ||
| // const volatile member function with six arguments | ||
| return ::f7(*this, i1, i2, i3, i4, i5, i6); | ||
| } | ||
| int cvf8(int i1, int i2, int i3, int i4, int i5, int i6, int i7) const | ||
| volatile { // const volatile member function with seven arguments | ||
| int cvf8(int i1, int i2, int i3, int i4, int i5, int i6, int i7) const volatile { | ||
| // const volatile member function with seven arguments | ||
| return ::f8(*this, i1, i2, i3, i4, i5, i6, i7); | ||
| } | ||
| int cvf9(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8) const | ||
| volatile { // const volatile member function with eight arguments | ||
| int cvf9(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8) const volatile { | ||
| // const volatile member function with eight arguments | ||
| return ::f9(*this, i1, i2, i3, i4, i5, i6, i7, i8); | ||
| } | ||
| int cvf10(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9) const | ||
| volatile { // const volatile member function with nine arguments | ||
| int cvf10(int i1, int i2, int i3, int i4, int i5, int i6, int i7, int i8, int i9) const volatile { | ||
| // const volatile member function with nine arguments | ||
| return ::f10(*this, i1, i2, i3, i4, i5, i6, i7, i8, i9); | ||
| } | ||
| int i0; | ||
|
|
@@ -626,3 +627,5 @@ const T& fake_lvalue(const T&& t) { // C++11 12.2 [class.temporary]/5: "A tempor | |
| // of the full-expression containing the call." | ||
| return t; | ||
| } | ||
|
|
||
| #pragma warning(pop) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've submitted an LWG issue (but not yet been assigned a number) to make the changes to both
value_oroverloads Standard.