From dbed7cceb8b453cc0ef78cc83f5466d5268037ba Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 20 May 2013 23:40:39 +0000 Subject: [PATCH] doc. parsing. HeaderDoc documentaton allows use of @class command on an @interface declaration. Turn off the warning for this case. // rdar://13927330 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@182334 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/CommentSema.cpp | 5 +++++ test/Sema/warn-documentation.m | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/lib/AST/CommentSema.cpp b/lib/AST/CommentSema.cpp index e0138d5f3f..c242eb0f60 100644 --- a/lib/AST/CommentSema.cpp +++ b/lib/AST/CommentSema.cpp @@ -132,6 +132,11 @@ void Sema::checkContainerDeclVerbatimLine(const BlockCommandComment *Comment) { switch (Comment->getCommandID()) { case CommandTraits::KCI_class: DiagSelect = !isClassOrStructDecl() ? 1 : 0; + // Allow @class command on @interface declarations. + // FIXME. Currently, \class and @class are indistinguishable. So, + // \class is also allowed on an @interface declaration + if (DiagSelect && Comment->getCommandMarker() && isObjCInterfaceDecl()) + DiagSelect = 0; break; case CommandTraits::KCI_interface: DiagSelect = !isObjCInterfaceDecl() ? 2 : 0; diff --git a/test/Sema/warn-documentation.m b/test/Sema/warn-documentation.m index 2720480509..1d3114617e 100644 --- a/test/Sema/warn-documentation.m +++ b/test/Sema/warn-documentation.m @@ -197,3 +197,9 @@ int FooBar(); { } @end + +// rdar://13927330 +/// @class Asset <- '@class' may be used in a comment attached to a an interface declaration +@interface Asset : NSObject +@end + -- 2.40.0