From db008af501534d4590542253ae3acf783986f5f7 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Mon, 8 Aug 2022 14:38:09 -0700 Subject: [PATCH] [llvm] Repair the modules build with C++17 I'm honestly not sure if this is a legitimate issue or not, but after switching from C++14 to C++17, the modules build started confusing arrays and initializer lists. Work around the issue by being explicit. --- llvm/include/llvm/ADT/STLExtras.h | 4 ++-- llvm/include/llvm/Support/FormatProviders.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h index 8e18b6a..c56ca97 100644 --- a/llvm/include/llvm/ADT/STLExtras.h +++ b/llvm/include/llvm/ADT/STLExtras.h @@ -725,8 +725,8 @@ class zip_shortest : public zip_common, Iters...> { template bool test(const zip_shortest &other, std::index_sequence) const { - return all_of(std::initializer_list{std::get(this->iterators) != - std::get(other.iterators)...}, + return all_of(std::array{std::get(this->iterators) != + std::get(other.iterators)...}, identity{}); } diff --git a/llvm/include/llvm/Support/FormatProviders.h b/llvm/include/llvm/Support/FormatProviders.h index 8101ed7..7cfce29 100644 --- a/llvm/include/llvm/Support/FormatProviders.h +++ b/llvm/include/llvm/Support/FormatProviders.h @@ -21,8 +21,8 @@ #include "llvm/Support/FormatVariadicDetails.h" #include "llvm/Support/NativeFormatting.h" +#include #include -#include namespace llvm { namespace detail { @@ -369,7 +369,7 @@ template class format_provider> { return Default; } - for (const char *D : {"[]", "<>", "()"}) { + for (const char *D : std::array{"[]", "<>", "()"}) { if (Style.front() != D[0]) continue; size_t End = Style.find_first_of(D[1]); -- 2.7.4