[libcxx-commits] [libcxx] [libcxx][P1831R1] Deprecating volatile: library (PR #101439)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Sep 5 08:05:31 PDT 2024
================
@@ -47,6 +47,7 @@ struct atomic : public __atomic_base<_Tp> {
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR atomic(_Tp __d) _NOEXCEPT : __base(__d) {}
----------------
ldionne wrote:
@jkarns275
> It seems like using a deprecated method doesn't trigger the warning in the case of a precompiled module - is this expected behavior?
This might be because the warning is emitted inside the body of the function. An alternative could be to try emitting the diagnostic in the declaration by doing something like
```c++
_LIBCPP_HIDE_FROM_ABI __deprecated_if_not_lock_free<_Tp*> operator=(_Tp* __d) volatile _NOEXCEPT {
__base::store(__d);
return __d;
}
```
where `__deprecated_if_not_lock_free` is defined to always expand to its argument as-is, but also trigger the warning if needed.
https://github.com/llvm/llvm-project/pull/101439
More information about the libcxx-commits
mailing list