[llvm] 2db6b34 - [llvm] Alternative attempt at fixing the modules build with C++17
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 8 21:59:29 PDT 2022
Author: Jonas Devlieghere
Date: 2022-08-08T21:59:22-07:00
New Revision: 2db6b34ea8136b02ef533268f0324541c7f93d95
URL: https://github.com/llvm/llvm-project/commit/2db6b34ea8136b02ef533268f0324541c7f93d95
DIFF: https://github.com/llvm/llvm-project/commit/2db6b34ea8136b02ef533268f0324541c7f93d95.diff
LOG: [llvm] Alternative attempt at fixing the modules build with C++17
My initial attempt in db008af50153 resulted in "error: no viable
constructor or deduction guide for deduction of template arguments of
'array'". Let's see if we can work around that by using an ArrayRef with
an explicit template argument.
Added:
Modified:
llvm/include/llvm/ADT/STLExtras.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h
index 8e18b6a95aac0..50f2cdf666ace 100644
--- a/llvm/include/llvm/ADT/STLExtras.h
+++ b/llvm/include/llvm/ADT/STLExtras.h
@@ -17,6 +17,7 @@
#ifndef LLVM_ADT_STLEXTRAS_H
#define LLVM_ADT_STLEXTRAS_H
+#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Optional.h"
#include "llvm/ADT/STLArrayExtras.h"
#include "llvm/ADT/STLForwardCompat.h"
@@ -725,8 +726,8 @@ class zip_shortest : public zip_common<zip_shortest<Iters...>, Iters...> {
template <size_t... Ns>
bool test(const zip_shortest<Iters...> &other,
std::index_sequence<Ns...>) const {
- return all_of(std::initializer_list<bool>{std::get<Ns>(this->iterators) !=
- std::get<Ns>(other.iterators)...},
+ return all_of(llvm::ArrayRef<bool>({std::get<Ns>(this->iterators) !=
+ std::get<Ns>(other.iterators)...}),
identity<bool>{});
}
More information about the llvm-commits
mailing list