[PATCH] D16565: [LLD] Fix Clang-tidy modernize-use-nullptr warnings in include/lld/Core/range.h; other minor fixes
Eugene Zelenko via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 25 18:17:10 PST 2016
Eugene.Zelenko created this revision.
Eugene.Zelenko added a reviewer: ruiu.
Eugene.Zelenko added a subscriber: llvm-commits.
Eugene.Zelenko set the repository for this revision to rL LLVM.
I checked this patch on my own build on RHEL 6. Regressions were OK.
Repository:
rL LLVM
http://reviews.llvm.org/D16565
Files:
include/lld/Core/range.h
Index: include/lld/Core/range.h
===================================================================
--- include/lld/Core/range.h
+++ include/lld/Core/range.h
@@ -29,8 +29,10 @@
namespace lld {
// Nothing in this namespace is part of the exported interface.
namespace detail {
+
using std::begin;
using std::end;
+
/// Used as the result type of undefined functions.
struct undefined {};
@@ -197,7 +199,7 @@
!std::is_pointer<Iterator>::value &&
detail::is_range<R>::value &&
std::is_convertible<typename detail::begin_result<R>::type,
- Iterator>::value>::type* = 0)
+ Iterator>::value>::type* = nullptr)
: begin_(detail::adl_begin(r)), end_(detail::adl_end(r)) {}
/// This constructor creates a \c range<T*> from any range with
@@ -229,7 +231,7 @@
&& detail::conversion_preserves_array_indexing<
decltype(&*detail::adl_begin(r)), Iterator>::value
#endif
- >::type* = 0)
+ >::type* = nullptr)
: begin_((detail::adl_begin(r) == detail::adl_end(r) &&
!std::is_pointer<decltype(detail::adl_begin(r))>::value)
// For non-pointers, &*begin(r) is only defined behavior
@@ -714,7 +716,7 @@
/// \c begin(r) and \c end(r) return the same type.
template <typename Range> LLVM_CONSTEXPR auto make_range(
Range &&r,
- typename std::enable_if<detail::is_range<Range>::value>::type* = 0)
+ typename std::enable_if<detail::is_range<Range>::value>::type* = nullptr)
-> range<decltype(detail::adl_begin(r))> {
return range<decltype(detail::adl_begin(r))>(r);
}
@@ -728,11 +730,11 @@
Range &&r,
typename std::enable_if<
detail::is_contiguous_range<Range>::value &&
- std::is_pointer<decltype(&*detail::adl_begin(r))>::value>::type* = 0)
- -> range<decltype(&*detail::adl_begin(r))> {
+ std::is_pointer<decltype(&*detail::adl_begin(r))>::value>::type* =
+ nullptr) -> range<decltype(&*detail::adl_begin(r))> {
return range<decltype(&*detail::adl_begin(r))>(r);
}
/// @}
} // end namespace lld
-#endif
+#endif // LLD_CORE_RANGE_H
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16565.45937.patch
Type: text/x-patch
Size: 2152 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160126/82876e8b/attachment.bin>
More information about the llvm-commits
mailing list