<div dir="ltr">The 't' was there because __builtin_va_start and __va_start had them, but those do in fact have custom sema checking so copying that was in fact incorrect. Thanks for fixing my bugs!</div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 2, 2018 at 4:41 PM, Reid Kleckner 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: rnk<br>
Date: Fri Mar  2 13:41:08 2018<br>
New Revision: 326622<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=326622&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=326622&view=rev</a><br>
Log:<br>
Don't claim that va_start has special semantic checks<br>
<br>
We don't have special checks for BI_va_start in<br>
Sema::<wbr>CheckBuiltinFunctionCall, so setting the 't' flag for va_start in<br>
Builtins.def disables semantic checking for it. That's not desired, and<br>
IRGen crashes when it tries to generate a call to va_start that doesn't<br>
have at least one argument.<br>
<br>
Follow-up to r322573<br>
<br>
Fixes PR36565<br>
<br>
Modified:<br>
    cfe/trunk/include/clang/Basic/<wbr>Builtins.def<br>
    cfe/trunk/test/Sema/varargs.c<br>
<br>
Modified: cfe/trunk/include/clang/Basic/<wbr>Builtins.def<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/Builtins.def?rev=326622&r1=326621&r2=326622&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/include/<wbr>clang/Basic/Builtins.def?rev=<wbr>326622&r1=326621&r2=326622&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/include/clang/Basic/<wbr>Builtins.def (original)<br>
+++ cfe/trunk/include/clang/Basic/<wbr>Builtins.def Fri Mar  2 13:41:08 2018<br>
@@ -803,7 +803,7 @@ LIBBUILTIN(_setjmpex, "iJ", "fj",   "set<br>
<br>
 // C99 library functions<br>
 // C99 stdarg.h<br>
-LIBBUILTIN(va_start, "vA.",       "fnt",   "stdarg.h", ALL_LANGUAGES)<br>
+LIBBUILTIN(va_start, "vA.",       "fn",    "stdarg.h", ALL_LANGUAGES)<br>
 LIBBUILTIN(va_end, "vA",          "fn",    "stdarg.h", ALL_LANGUAGES)<br>
 LIBBUILTIN(va_copy, "vAA",        "fn",    "stdarg.h", ALL_LANGUAGES)<br>
 // C99 stdlib.h<br>
<br>
Modified: cfe/trunk/test/Sema/varargs.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/varargs.c?rev=326622&r1=326621&r2=326622&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/Sema/<wbr>varargs.c?rev=326622&r1=<wbr>326621&r2=326622&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/Sema/varargs.c (original)<br>
+++ cfe/trunk/test/Sema/varargs.c Fri Mar  2 13:41:08 2018<br>
@@ -112,3 +112,12 @@ void f13(enum E1 e, ...) {<br>
 #endif<br>
   __builtin_va_end(va);<br>
 }<br>
+<br>
+void f14(int e, ...) {<br>
+  // expected-warning@+3 {{implicitly declaring library function 'va_start'}}<br>
+  // expected-note@+2 {{include the header <stdarg.h>}}<br>
+  // expected-error@+1 {{too few arguments to function call}}<br>
+  va_start();<br>
+  __builtin_va_list va;<br>
+  va_start(va, e);<br>
+}<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">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/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>