[PATCH] D94769: [Support] Format provider improvements
Vladislav Vinogradov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jan 17 05:13:26 PST 2021
vinograd47 updated this revision to Diff 317215.
vinograd47 added a comment.
Suppress clang-tidy diagnostic about class member name.
It is a common name for compile-time checks implemented via template classes : `SomeSheck<T>::value`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D94769/new/
https://reviews.llvm.org/D94769
Files:
llvm/include/llvm/Support/FormatProviders.h
llvm/include/llvm/Support/FormatVariadicDetails.h
Index: llvm/include/llvm/Support/FormatVariadicDetails.h
===================================================================
--- llvm/include/llvm/Support/FormatVariadicDetails.h
+++ llvm/include/llvm/Support/FormatVariadicDetails.h
@@ -75,8 +75,6 @@
// Test if raw_ostream& << T -> raw_ostream& is findable via ADL.
template <class T> class has_StreamOperator {
public:
- using ConstRefT = const std::decay_t<T> &;
-
template <typename U>
static char test(
std::enable_if_t<std::is_same<decltype(std::declval<llvm::raw_ostream &>()
@@ -86,7 +84,8 @@
template <typename U> static double test(...);
- static bool const value = (sizeof(test<ConstRefT>(nullptr)) == 1);
+ // NOLINTNEXTLINE(readability-identifier-naming)
+ static bool const value = (sizeof(test<T>(nullptr)) == 1);
};
// Simple template that decides whether a type T should use the member-function
Index: llvm/include/llvm/Support/FormatProviders.h
===================================================================
--- llvm/include/llvm/Support/FormatProviders.h
+++ llvm/include/llvm/Support/FormatProviders.h
@@ -355,7 +355,6 @@
template <typename IterT> class format_provider<llvm::iterator_range<IterT>> {
using value = typename std::iterator_traits<IterT>::value_type;
- using reference = typename std::iterator_traits<IterT>::reference;
static StringRef consumeOneOption(StringRef &Style, char Indicator,
StringRef Default) {
@@ -403,15 +402,13 @@
auto Begin = V.begin();
auto End = V.end();
if (Begin != End) {
- auto Adapter =
- detail::build_format_adapter(std::forward<reference>(*Begin));
+ auto Adapter = detail::build_format_adapter(*Begin);
Adapter.format(Stream, ArgStyle);
++Begin;
}
while (Begin != End) {
Stream << Sep;
- auto Adapter =
- detail::build_format_adapter(std::forward<reference>(*Begin));
+ auto Adapter = detail::build_format_adapter(*Begin);
Adapter.format(Stream, ArgStyle);
++Begin;
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94769.317215.patch
Type: text/x-patch
Size: 2069 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210117/87715439/attachment.bin>
More information about the llvm-commits
mailing list