objc: warn if NSObject attribute appears other than in a typedef.
// rdar://10453342
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145358 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 74d22e7..e60cd63 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -1746,6 +1746,10 @@
return;
}
}
+ else {
+ S.Diag(D->getLocation(), diag::warn_nsobject_attribute);
+ return;
+ }
D->addAttr(::new (S.Context) ObjCNSObjectAttr(Attr.getRange(), S.Context));
}