Don't claim that va_start has special semantic checks

We don't have special checks for BI_va_start in
Sema::CheckBuiltinFunctionCall, so setting the 't' flag for va_start in
Builtins.def disables semantic checking for it. That's not desired, and
IRGen crashes when it tries to generate a call to va_start that doesn't
have at least one argument.

Follow-up to r322573

Fixes PR36565

llvm-svn: 326622
This commit is contained in:
Reid Kleckner 2018-03-02 21:41:08 +00:00
parent 334fa57456
commit a991695e49
2 changed files with 10 additions and 1 deletions

View File

@ -803,7 +803,7 @@ LIBBUILTIN(_setjmpex, "iJ", "fj", "setjmpex.h", ALL_MS_LANGUAGES)
// C99 library functions
// C99 stdarg.h
LIBBUILTIN(va_start, "vA.", "fnt", "stdarg.h", ALL_LANGUAGES)
LIBBUILTIN(va_start, "vA.", "fn", "stdarg.h", ALL_LANGUAGES)
LIBBUILTIN(va_end, "vA", "fn", "stdarg.h", ALL_LANGUAGES)
LIBBUILTIN(va_copy, "vAA", "fn", "stdarg.h", ALL_LANGUAGES)
// C99 stdlib.h

View File

@ -112,3 +112,12 @@ void f13(enum E1 e, ...) {
#endif
__builtin_va_end(va);
}
void f14(int e, ...) {
// expected-warning@+3 {{implicitly declaring library function 'va_start'}}
// expected-note@+2 {{include the header <stdarg.h>}}
// expected-error@+1 {{too few arguments to function call}}
va_start();
__builtin_va_list va;
va_start(va, e);
}