diff options
Diffstat (limited to 'lib/AST/CommentSema.cpp')
-rw-r--r-- | lib/AST/CommentSema.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/AST/CommentSema.cpp b/lib/AST/CommentSema.cpp index fd2b5b1810..73e49e71db 100644 --- a/lib/AST/CommentSema.cpp +++ b/lib/AST/CommentSema.cpp @@ -465,6 +465,9 @@ void Sema::checkReturnsCommand(const BlockCommandComment *Command) { } return; } + else if (isObjCPropertyDecl()) + return; + Diag(Command->getLocation(), diag::warn_doc_returns_not_attached_to_a_function_decl) << Command->getCommandName(Traits) @@ -652,6 +655,14 @@ bool Sema::isFunctionDecl() { inspectThisDecl(); return ThisDeclInfo->getKind() == DeclInfo::FunctionKind; } + +bool Sema::isObjCPropertyDecl() { + if (!ThisDeclInfo) + return false; + if (!ThisDeclInfo->IsFilled) + inspectThisDecl(); + return ThisDeclInfo->CurrentDecl->getKind() == Decl::ObjCProperty; +} bool Sema::isTemplateOrSpecialization() { if (!ThisDeclInfo) |