Fixe bogus error for variable argument methods. Sema::ObjcGetTypeForMethodDefinition() wasn't preserving the isVariadic boolean. Another fix is to avoid synthsizing the function decl entirely, however this is a separate issue that I don't want to deal with now. Also added a FIXME to Sema::CheckFunctionCall(), which is currently emitting a bogus warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45146 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaChecking.cpp b/Sema/SemaChecking.cpp
index b366a2b..4d2e362 100644
--- a/Sema/SemaChecking.cpp
+++ b/Sema/SemaChecking.cpp
@@ -62,7 +62,7 @@
diag::err_va_start_used_in_non_variadic_function);
return true;
}
-
+ // FIXME: This isn't correct for methods (results in bogus warning).
bool SecondArgIsLastNamedArgument = false;
if (DeclRefExpr *DR = dyn_cast<DeclRefExpr>(Args[1])) {
if (ParmVarDecl *PV = dyn_cast<ParmVarDecl>(DR->getDecl())) {
diff --git a/Sema/SemaType.cpp b/Sema/SemaType.cpp
index c89018a..a9b8066 100644
--- a/Sema/SemaType.cpp
+++ b/Sema/SemaType.cpp
@@ -366,7 +366,7 @@
ArgTys.push_back(ArgTy);
}
T = Context.getFunctionType(T, &ArgTys[0], ArgTys.size(),
- false);
+ MDecl->isVariadic());
return T;
}