[libcxx-commits] [PATCH] D104980: [libcxx][NFC] replaces `<utility>` includes with specific headers
Christopher Di Bella via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 28 10:15:53 PDT 2021
cjdb added inline comments.
================
Comment at: libcxx/include/__functional/greater.h:52-55
+ _NOEXCEPT_(noexcept(static_cast<_T1&&>(__t) > static_cast<_T2&&>(__u)))
+ -> decltype (static_cast<_T1&&>(__t) > static_cast<_T2&&>(__u))
+ { return static_cast<_T1&&>(__t) > static_cast<_T2&&>(__u); }
typedef void is_transparent;
----------------
ldionne wrote:
> What's the rationale for making this change here? Why not include `__utility/forward.h`?
Oh, did this slip through? I was experimenting with something and then abandoned it. Will fix.
================
Comment at: libcxx/include/type_traits:1366-1375
-// Suppress deprecation notice for volatile-qualified return type resulting
-// from volatile-qualified types _Tp.
-_LIBCPP_SUPPRESS_DEPRECATED_PUSH
-template <class _Tp> _Tp&& __declval(int);
-template <class _Tp> _Tp __declval(long);
-_LIBCPP_SUPPRESS_DEPRECATED_POP
-
----------------
ldionne wrote:
> Why this? And most importantly, why is it in this patch?
Seems I did a copy/paste instead of cut/paste. `declval` already had its own header but was never removed from `type_traits`, and we're not violating the ODR by declaring it twice in two different places (but diagnostics point to `<type_traits>` instead of `<utility>`).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104980/new/
https://reviews.llvm.org/D104980
More information about the libcxx-commits
mailing list