-
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
Conversation
* `<optional>`: `optional::value_or` now returns `remove_cv_t<_Ty>` because it's silly to have a cv-qualified return type (Needs LWG issue). * `<variant>`: Suppress deprecation warnings when forming the "imaginary" overload set `FUN` for the `variant(T&&)` constructor. * Add the new warning C5215 "'%s' a function parameter with volatile qualified type is deprecated in C++20" to libc++'s "suppress deprecation warnings" macro and update llvm submodule reference. * Skip libc++ test `containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cpp` after seeing one timeout too many in Contest logs. * Suppress C5215 in `tr1/include/tfuns.h` which uses volatile function parameters. * Update skips for two libc++ tests that changed suffixes from `.sh.cpp` to `.pass.cpp`.
* `std::any_cast` should never return a cv-qualified type * Guard `_Implicitly_convert_to` against C5215 * Disable C5215 in `tr1/functional4`
| // 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 |
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.
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.
|
|
||
| template <class _Ty2> | ||
| _NODISCARD constexpr _Ty value_or(_Ty2&& _Right) const& { | ||
| _NODISCARD constexpr remove_cv_t<_Ty> value_or(_Ty2&& _Right) const& { |
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_or overloads Standard.
...per the wording changes in as-yet-unnumbered LWG issues.
| #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 |
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 find it somewhat interesting that you don't need to suppress Clang -Wdeprecated-volatile here. But if there are no warnings in our test suite, I'm happy.
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.
We probably should; this will be in some future set of "suppress clang warnings that don't show up because system header" 🤷♂ .
.... to enable libcxx to continue working after upstream changes to pass configuration to the filesystem tests which we do not run.
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'm approving the test harness changes (which were trivial).
containers/sequences/deque/deque.modifiers/insert_iter_iter.pass.cppafter seeing one timeout too many in Contest logs.tr1/include/tfuns.hwhich uses volatile function parameters..sh.cppto.pass.cpp.[This is a dual of internal MSVC-PR-239335.]