diff options
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/AST/CommentSema.cpp | 5 | ||||
-rw-r--r-- | clang/test/Sema/warn-documentation.m | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/AST/CommentSema.cpp b/clang/lib/AST/CommentSema.cpp index e0138d5f3f2..c242eb0f606 100644 --- a/clang/lib/AST/CommentSema.cpp +++ b/clang/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/clang/test/Sema/warn-documentation.m b/clang/test/Sema/warn-documentation.m index 27204805096..1d3114617eb 100644 --- a/clang/test/Sema/warn-documentation.m +++ b/clang/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 + |