[libcxx-commits] [PATCH] D130854: [libc++][NFC] Qualify declaval

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Aug 3 10:41:35 PDT 2022


Mordante added a comment.

Can you update the commit message with a before and after, showing the improvement?
That makes the reason for the change less "cryptic".

SGTM modulo some nits. I really want to have a second look, mainly to make sure I didn't miss some places in this review.



================
Comment at: libcxx/include/__iterator/move_iterator.h:52
 concept __move_iter_comparable = requires {
-    { declval<const _Iter&>() == declval<_Sent>() } -> convertible_to<bool>;
+    { declval<const _Iter&>() == std::declval<_Sent>() } -> convertible_to<bool>;
 };
----------------



================
Comment at: libcxx/include/__memory/construct_at.h:32
 
-template <class _Tp, class... _Args, class = decltype(::new(declval<void*>()) _Tp(declval<_Args>()...))>
+template <class _Tp, class... _Args, class = decltype(::new(declval<void*>()) _Tp(std::declval<_Args>()...))>
 _LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {
----------------



================
Comment at: libcxx/include/__memory/construct_at.h:40
 
-template <class _Tp, class... _Args, class = decltype(::new(declval<void*>()) _Tp(declval<_Args>()...))>
+template <class _Tp, class... _Args, class = decltype(::new(declval<void*>()) _Tp(std::declval<_Args>()...))>
 _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR _Tp* __construct_at(_Tp* __location, _Args&&... __args) {
----------------



================
Comment at: libcxx/include/__memory/ranges_construct_at.h:41
   template<class _Tp, class... _Args, class = decltype(
-    ::new (declval<void*>()) _Tp(declval<_Args>()...)
+    ::new (declval<void*>()) _Tp(std::declval<_Args>()...)
   )>
----------------



================
Comment at: libcxx/include/__utility/declval.h:30
 template <class _Tp>
-decltype(__declval<_Tp>(0)) declval() _NOEXCEPT;
+decltype(std::__declval<_Tp>(0)) declval() _NOEXCEPT;
 
----------------
This looks off, you only ADL-proved the call to `__declval`. (This isn't needed, but I don't object against this change.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130854/new/

https://reviews.llvm.org/D130854



More information about the libcxx-commits mailing list