Elimate bogus warning when va_start is correctly used in
a method. llvm-svn: 46232
This commit is contained in:
parent
c505c6792c
commit
7718e36e25
|
@ -64,7 +64,7 @@ void Sema::ObjCActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
|
|||
PI.Ident = PDecl->getIdentifier();
|
||||
PI.IdentLoc = PDecl->getLocation(); // user vars have a real location.
|
||||
PI.TypeInfo = PDecl->getType().getAsOpaquePtr();
|
||||
ActOnParamDeclarator(PI, FnBodyScope);
|
||||
MDecl->setParamDecl(i, ActOnParamDeclarator(PI, FnBodyScope));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -135,6 +135,9 @@ public:
|
|||
assert(i < getNumParams() && "Illegal param #");
|
||||
return ParamInfo[i];
|
||||
}
|
||||
void setParamDecl(int i, ParmVarDecl *pDecl) {
|
||||
ParamInfo[i] = pDecl;
|
||||
}
|
||||
void setMethodParams(ParmVarDecl **NewParamInfo, unsigned NumParams);
|
||||
|
||||
AttributeList *getMethodAttrs() const {return MethodAttrs;}
|
||||
|
|
|
@ -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);
|
||||
while (*types) ;
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
@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}}
|
||||
va_start(ap, types);
|
||||
while (*types) ;
|
||||
va_end(ap);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue