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/test/Sema/va-method.m b/test/Sema/va-method.m
new file mode 100644
index 0000000..a8a7053
--- /dev/null
+++ b/test/Sema/va-method.m
@@ -0,0 +1,17 @@
+// RUN: clang -fsyntax-only -verify %s
+
+#include <stdarg.h>
+
+@interface NSObject @end
+@interface XX : NSObject @end
+
+@implementation XX
+- (void)encodeValuesOfObjCTypes:(const char *)types, ... {
+ va_list ap;
+ va_start(ap, types); // expected-warning {{second parameter of 'va_start' not last named argument}}
+ while (*types) ;
+ va_end(ap);
+}
+
+@end
+