<div dir="ltr">Yep, reproduces even with a plain (non template arg) function pointer - and immediately goes away with a real function of the same type.<br><br>That's bothersome. I played around with a few ways of writing the call-to-function-pointer but couldn't find any particular syntax that seemed to untickle GCC's problem here. Maybe if you find the filed GCC bug there might be a workaround listed (if it's been filed/investigated already).</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 31, 2016 at 6:53 AM, Samuel Benzaquen <span dir="ltr"><<a href="mailto:sbenza@google.com" target="_blank">sbenza@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I was able to reduce the bug to this:<div><br></div><div><div><font face="monospace, monospace">struct A {                                                                         </font></div><div><font face="monospace, monospace">  A(int (&)[1]);                                                                   </font></div><div><font face="monospace, monospace">};                                                                                 </font></div><div><font face="monospace, monospace">template <int (*F)(A)>                                                             </font></div><div><font face="monospace, monospace">int E() {                                                                          </font></div><div><font face="monospace, monospace">  int X[] = {0};                                                                   </font></div><div><font face="monospace, monospace">  return F(X);                                                                     </font></div><div><font face="monospace, monospace">}                                                                                  </font></div></div><div><br></div><div>Note that the array is not empty and we are not using variadics anymore.<br></div><div>The problem seems to be related to the function pointer template parameter.</div><div>gcc doesn't want to do the implicit conversion from X to A, but if I make the conversion explicit it works.</div><div><div class="h5"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 25, 2016 at 1:58 PM, Alexey Samsonov <span dir="ltr"><<a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><span>On Fri, Mar 25, 2016 at 10:55 AM, David Blaikie via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span>On Fri, Mar 25, 2016 at 10:46 AM, Samuel Benzaquen via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">Author: sbenza<br>
Date: Fri Mar 25 12:46:02 2016<br>
New Revision: 264428<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=264428&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=264428&view=rev</a><br>
Log:<br>
[ASTMatchers] Fix build for VariadicFunction.<br>
<br>
Under some conditions the implicit conversion from array to ArrayRef<><br>
is not working.<br></blockquote><div><br></div></span><div>Any idea what those conditions are?</div></div></div></div></blockquote><div><br></div></span><div>This was causing the build failure with opt GCC. I will try to create a smaller reproducer later today.</div><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
Fix the build by making it explicit.<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h<br>
<br>
Modified: cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h?rev=264428&r1=264427&r2=264428&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h?rev=264428&r1=264427&r2=264428&view=diff</a><br>
==============================================================================<br>
--- cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h (original)<br>
+++ cfe/trunk/include/clang/ASTMatchers/ASTMatchersInternal.h Fri Mar 25 12:46:02 2016<br>
@@ -90,7 +90,7 @@ private:<br>
   // before we make the array.<br>
   template <typename... ArgsT> ResultT Execute(const ArgsT &... Args) const {<br>
     const ArgT *const ArgsArray[] = {&Args...};<br>
-    return Func(ArgsArray);<br>
+    return Func(ArrayRef<const ArgT *>(ArgsArray, sizeof...(ArgsT)));<br>
   }<br>
 };<br>
<br>
<br>
<br>
_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
</blockquote></span></div><br></div></div>
<br>_______________________________________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits</a><br>
<br></blockquote></span></div><span><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div><div dir="ltr">Alexey Samsonov<br><a href="mailto:vonosmas@gmail.com" target="_blank">vonosmas@gmail.com</a></div></div>
</font></span></div></div>
</blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div>