<div dir="ltr">Ping</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Aug 9, 2022 at 8:27 AM David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">These "I don't know why they work but they do" Workarounds continue to happen for modules & they're pretty unsatisfying.<br><br>Any chance you could look into this a bit more to understand why they're broken/why this is the right fix? (partly because I expect we have quite a few range-based-for loops with initializer lists, and figuring out when some need explicit types and some don't seems like it'd be hard and confusing going forward)</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Aug 8, 2022 at 3:04 PM Jonas Devlieghere via llvm-commits <<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
Author: Jonas Devlieghere<br>
Date: 2022-08-08T15:04:46-07:00<br>
New Revision: db008af501534d4590542253ae3acf783986f5f7<br>
<br>
URL: <a href="https://github.com/llvm/llvm-project/commit/db008af501534d4590542253ae3acf783986f5f7" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/db008af501534d4590542253ae3acf783986f5f7</a><br>
DIFF: <a href="https://github.com/llvm/llvm-project/commit/db008af501534d4590542253ae3acf783986f5f7.diff" rel="noreferrer" target="_blank">https://github.com/llvm/llvm-project/commit/db008af501534d4590542253ae3acf783986f5f7.diff</a><br>
<br>
LOG: [llvm] Repair the modules build with C++17<br>
<br>
I'm honestly not sure if this is a legitimate issue or not, but after<br>
switching from C++14 to C++17, the modules build started confusing<br>
arrays and initializer lists. Work around the issue by being explicit.<br>
<br>
Added: <br>
<br>
<br>
Modified: <br>
    llvm/include/llvm/ADT/STLExtras.h<br>
    llvm/include/llvm/Support/FormatProviders.h<br>
<br>
Removed: <br>
<br>
<br>
<br>
################################################################################<br>
diff  --git a/llvm/include/llvm/ADT/STLExtras.h b/llvm/include/llvm/ADT/STLExtras.h<br>
index 8e18b6a95aac0..c56ca97856c2b 100644<br>
--- a/llvm/include/llvm/ADT/STLExtras.h<br>
+++ b/llvm/include/llvm/ADT/STLExtras.h<br>
@@ -725,8 +725,8 @@ class zip_shortest : public zip_common<zip_shortest<Iters...>, Iters...> {<br>
   template <size_t... Ns><br>
   bool test(const zip_shortest<Iters...> &other,<br>
             std::index_sequence<Ns...>) const {<br>
-    return all_of(std::initializer_list<bool>{std::get<Ns>(this->iterators) !=<br>
-                                              std::get<Ns>(other.iterators)...},<br>
+    return all_of(std::array{std::get<Ns>(this->iterators) !=<br>
+                             std::get<Ns>(other.iterators)...},<br>
                   identity<bool>{});<br>
   }<br>
<br>
<br>
diff  --git a/llvm/include/llvm/Support/FormatProviders.h b/llvm/include/llvm/Support/FormatProviders.h<br>
index 8101ed7968adb..7cfce29b134fc 100644<br>
--- a/llvm/include/llvm/Support/FormatProviders.h<br>
+++ b/llvm/include/llvm/Support/FormatProviders.h<br>
@@ -21,8 +21,8 @@<br>
 #include "llvm/Support/FormatVariadicDetails.h"<br>
 #include "llvm/Support/NativeFormatting.h"<br>
<br>
+#include <array><br>
 #include <type_traits><br>
-#include <vector><br>
<br>
 namespace llvm {<br>
 namespace detail {<br>
@@ -369,7 +369,7 @@ template <typename IterT> class format_provider<llvm::iterator_range<IterT>> {<br>
       return Default;<br>
     }<br>
<br>
-    for (const char *D : {"[]", "<>", "()"}) {<br>
+    for (const char *D : std::array{"[]", "<>", "()"}) {<br>
       if (Style.front() != D[0])<br>
         continue;<br>
       size_t End = Style.find_first_of(D[1]);<br>
<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</blockquote></div>
</blockquote></div>