aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/AST/Comment.cpp2
-rw-r--r--lib/AST/CommentSema.cpp5
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp
index ac224ccecd..e35b2a3d5e 100644
--- a/lib/AST/Comment.cpp
+++ b/lib/AST/Comment.cpp
@@ -145,6 +145,7 @@ void DeclInfo::fill() {
IsTemplateDecl = false;
IsTemplateSpecialization = false;
IsTemplatePartialSpecialization = false;
+ IsObjCMethod = false;
IsInstanceMethod = false;
IsClassMethod = false;
ParamVars = ArrayRef<const ParmVarDecl *>();
@@ -193,6 +194,7 @@ void DeclInfo::fill() {
ParamVars = ArrayRef<const ParmVarDecl *>(MD->param_begin(),
MD->param_size());
ResultType = MD->getResultType();
+ IsObjCMethod = true;
IsInstanceMethod = MD->isInstanceMethod();
IsClassMethod = !IsInstanceMethod;
break;
diff --git a/lib/AST/CommentSema.cpp b/lib/AST/CommentSema.cpp
index c8422508d3..770d5bba24 100644
--- a/lib/AST/CommentSema.cpp
+++ b/lib/AST/CommentSema.cpp
@@ -481,7 +481,10 @@ void Sema::checkReturnsCommand(const BlockCommandComment *Command) {
unsigned DiagKind;
switch (ThisDeclInfo->ThisDecl->getKind()) {
default:
- DiagKind = 0;
+ if (ThisDeclInfo->IsObjCMethod)
+ DiagKind = 3;
+ else
+ DiagKind = 0;
break;
case Decl::CXXConstructor:
DiagKind = 1;