for variable arguments list methods. (radar
8006060).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104407
91177308-0d34-0410-b5e6-
96231b3b80d8
def warn_conflicting_param_types : Warning<
"conflicting parameter types in implementation of %0: %1 vs %2">;
+def warn_conflicting_variadic :Warning<
+ "conflicting variadic declaration of method and its implementation">;
def warn_implements_nscopying : Warning<
"default assign attribute on property %0 which implements "
<< (*IM)->getType();
Diag((*IF)->getLocation(), diag::note_previous_definition);
}
+ if (ImpMethodDecl->isVariadic() != IntfMethodDecl->isVariadic()) {
+ Diag(ImpMethodDecl->getLocation(), diag::warn_conflicting_variadic);
+ Diag(IntfMethodDecl->getLocation(), diag::note_previous_declaration);
+ }
}
/// FIXME: Type hierarchies in Objective-C can be deep. We could most likely
return 0;
}
@end
+
+// rdar: // 8006060
+@interface Bar
+- (void)foo:(id)format, ...; // expected-note {{previous declaration is here}}
+- (void)foo1:(id)format; // expected-note {{previous declaration is here}}
+@end
+@implementation Bar
+- (void)foo:(id)format {}; // expected-warning {{conflicting variadic declaration of method and its implementation}}
+- (void)foo1:(id)format, ... {}; // expected-warning {{conflicting variadic declaration of method and its implementation}}
+@end
+