forked from OSchip/llvm-project
Fix a regression from my fix to PR2631. Fixes PR2692.
llvm-svn: 55083
This commit is contained in:
parent
002ad1274b
commit
1be92d297a
|
@ -2613,6 +2613,8 @@ Sema::ExprResult Sema::ActOnVAArg(SourceLocation BuiltinLoc,
|
|||
// a pointer for va_arg.
|
||||
if (VaListType->isArrayType())
|
||||
VaListType = Context.getArrayDecayedType(VaListType);
|
||||
// Make sure the input expression also decays appropriately.
|
||||
UsualUnaryConversions(E);
|
||||
|
||||
if (CheckAssignmentConstraints(VaListType, E->getType()) != Compatible)
|
||||
return Diag(E->getLocStart(),
|
||||
|
|
|
@ -1,6 +1,16 @@
|
|||
// RUN: clang -fsyntax-only -verify -triple=x86_64-unknown-freebsd7.0 %s
|
||||
|
||||
// PR2631
|
||||
char* foo(char *fmt, __builtin_va_list ap)
|
||||
{
|
||||
return __builtin_va_arg((ap), char *);
|
||||
}
|
||||
|
||||
// PR2692
|
||||
typedef __builtin_va_list va_list;
|
||||
static char *f (char * (*g) (char **, int), char **p, ...) {
|
||||
char *s;
|
||||
va_list v;
|
||||
s = g (p, __builtin_va_arg(v, int));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue