<div dir="ltr"><a class="gmail_plusreply" id="plusReplyChip-0" href="mailto:joker.eph@gmail.com" tabindex="-1">+Mehdi AMINI</a> in case he's got any ideas<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 20, 2021 at 3:36 AM Diana Picus via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@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"><div dir="ltr">Hi,<br><br>I'm trying to compile MLIR on Windows on Arm with a clang-cl.exe that I compiled at commit 945df8bc4cf.<div><br></div><div>I'm running into an issue in mlir-tblgen\RewriterGen.cpp [1]. I'm attaching the whole error dump, but here's the TL;DR version:<br><br>error: implicit instantiation of undefined template 'llvm::detail::missing_format_adapter<llvm::SmallVector<std::basic_string<char>, 8> &>'<br>[...]<br>llvm-project\mlir\tools\mlir-tblgen\RewriterGen.cpp(303,37): note: in instantiation of template class 'mlir::tblgen::FmtObject<std::tuple<llvm::detail::missing_format_adapter<llvm::SmallVector<std::basic_string<char>, 8> &>>>' requested here<br>  auto nativeCodeCall = std::string(tgfmt(<br><br>I'm not sure I understand the issue correctly, but in any case here's my interpretation:<br>There are 2 versions of tgfmt, a templated one with a parameter pack [2], and a non-templated one that takes an ArrayRef<std::string> as a parameter. I would expect a call with SmallVector<std::string, 8> to just use the non-templated overload, but we never get to that part because we're erroring out while trying to find a format adapter. I think SFINAE doesn't kick in in this case, because the error is not in "an immediate context of the function type". However, removing the build_format_adapter definition that uses the missing_format_adapter [3] makes it work, because I guess in that case the error is pushed into the immediate context (i.e. we error out because we don't have a suitable build_format_adapter, not later on because we don't have a missing_format_adapter).</div><div><br></div><div>Am I understanding this right? Is it reasonable to remove missing_format_adapter in order to make build_format_adapter more SFINAE-friendly? Or is there a more principled fix?</div><div><br></div><div>Thanks,</div><div>Diana<br><br></div><div>[1] <a href="https://github.com/llvm/llvm-project/blob/951f362e2560fe1c9c05f487107fd9882d45d867/mlir/tools/mlir-tblgen/RewriterGen.cpp#L303" target="_blank">https://github.com/llvm/llvm-project/blob/951f362e2560fe1c9c05f487107fd9882d45d867/mlir/tools/mlir-tblgen/RewriterGen.cpp#L303</a></div><div>[2] <a href="https://github.com/llvm/llvm-project/blob/5bc9cc1332aa042b68fb5efa9fb50eaaf2d54f79/mlir/include/mlir/TableGen/Format.h#L255" target="_blank">https://github.com/llvm/llvm-project/blob/5bc9cc1332aa042b68fb5efa9fb50eaaf2d54f79/mlir/include/mlir/TableGen/Format.h#L255</a></div><div>[3] <a href="https://github.com/llvm/llvm-project/blob/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e/llvm/include/llvm/Support/FormatVariadicDetails.h#L156" target="_blank">https://github.com/llvm/llvm-project/blob/d480f968ad8b56d3ee4a6b6df5532d485b0ad01e/llvm/include/llvm/Support/FormatVariadicDetails.h#L156</a></div></div>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>