]> granicus.if.org Git - clang/commitdiff
doc. parsing. HeaderDoc documentaton allows use of
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 20 May 2013 23:40:39 +0000 (23:40 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 20 May 2013 23:40:39 +0000 (23:40 +0000)
@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
test/Sema/warn-documentation.m

index e0138d5f3f276593114a42d8187dd8e829e5e3bc..c242eb0f6067b70bb584e0acc184f22b62a7973f 100644 (file)
@@ -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;
index 272048050966e4f5e1aa613261e73d644aedf48b..1d3114617ebbd719e74965d8c117fa051d928697 100644 (file)
@@ -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
+