forked from OSchip/llvm-project
parent
bc7748b7d3
commit
e96f9c816b
|
@ -2321,11 +2321,15 @@ static inline
|
|||
bool containsInvalidMethodImplAttribute(ObjCMethodDecl *IMD,
|
||||
const AttrVec &A) {
|
||||
// If method is only declared in implementation (private method),
|
||||
// or method declared in interface has no attribute.
|
||||
// No need to issue any diagnostics on method definition with attributes.
|
||||
if (!IMD || !IMD->hasAttrs())
|
||||
if (!IMD)
|
||||
return false;
|
||||
|
||||
// method declared in interface has no attribute.
|
||||
// But implementation has attributes. This is invalid
|
||||
if (!IMD->hasAttrs())
|
||||
return true;
|
||||
|
||||
const AttrVec &D = IMD->getAttrs();
|
||||
if (D.size() != A.size())
|
||||
return true;
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
@end
|
||||
|
||||
@implementation INTF
|
||||
- (int) foo: (int)arg1 __attribute__((deprecated)){
|
||||
- (int) foo: (int)arg1 __attribute__((deprecated)){ // expected-warning {{method attribute can only be specified}}
|
||||
return 10;
|
||||
}
|
||||
- (int) foo1: (int)arg1 {
|
||||
|
|
Loading…
Reference in New Issue