diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-05-28 17:02:35 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-05-28 17:02:35 +0000 |
commit | 3451df8f5dfc1a7a742ac32b50ca7420e0f939c0 (patch) | |
tree | cac7674d99171a75ba01b56d6f21eccbbf0bbf89 /clang/lib/Sema/SemaDecl.cpp | |
parent | 34558184a06849488c5165605e7edf5424b2cf1b (diff) | |
download | bcm5719-llvm-3451df8f5dfc1a7a742ac32b50ca7420e0f939c0.tar.gz bcm5719-llvm-3451df8f5dfc1a7a742ac32b50ca7420e0f939c0.zip |
Objective-C. Deprecate use of function definitions
in Objective-C container declarations (but not
in their definitions. // rdar://10414277
llvm-svn: 209751
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index a0ce7663a82..ede333d9891 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -9797,6 +9797,11 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D) { // We want to attach documentation to original Decl (which might be // a function template). ActOnDocumentableDecl(D); + if (getCurLexicalContext()->isObjCContainer() && + getCurLexicalContext()->getDeclKind() != Decl::ObjCCategoryImpl && + getCurLexicalContext()->getDeclKind() != Decl::ObjCImplementation) + Diag(FD->getLocation(), diag::warn_function_def_in_objc_container); + return D; } |