]> granicus.if.org Git - clang/commitdiff
comment parsing. Missed a case of referring
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 4 Mar 2013 18:53:41 +0000 (18:53 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 4 Mar 2013 18:53:41 +0000 (18:53 +0000)
to original command in diagnostic. // rdar://13066276

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176444 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticCommentKinds.td
lib/AST/CommentSema.cpp
test/Sema/warn-documentation.cpp

index f8a2af398d5c0a4088d59779fd7bdbe987074058..73c0dc9dd08d734f1fef5dfb59dd1fcae03d5391 100644 (file)
@@ -69,7 +69,7 @@ def warn_doc_param_spaces_in_direction : Warning<
   InGroup<DocumentationPedantic>, DefaultIgnore;
 
 def warn_doc_param_not_attached_to_a_function_decl : Warning<
-  "'\\param' command used in a comment that is not attached to "
+  "'%select{\\|@}0param' command used in a comment that is not attached to "
   "a function declaration">,
   InGroup<Documentation>, DefaultIgnore;
 
index e7bd5c8cad2bbdfc332e98a90cc82bfaa5fb1f4e..3e4b28356b9bcd7156f3dc4c0fc8e80c2257ad52 100644 (file)
@@ -78,6 +78,7 @@ ParamCommandComment *Sema::actOnParamCommandStart(SourceLocation LocBegin,
   if (!isFunctionDecl())
     Diag(Command->getLocation(),
          diag::warn_doc_param_not_attached_to_a_function_decl)
+      << AtCommand
       << Command->getCommandNameRange(Traits);
 
   return Command;
index d166ae0b5845f6ee240f34a1a986594ef146e09a..f9eb458ce8d85589b7a69a36cab507f509a9f33d 100644 (file)
@@ -907,3 +907,11 @@ struct s;
 struct q* g(void);
 struct q;
 
+// expected-warning@+3 {{'@param' command used in a comment that is not attached to a function declaration}}
+// expected-warning@+3 {{'@result' command used in a comment that is not attached to a function or method declaration}}
+/*!    @function Base64EncodeEx
+       @param  inFlags  This is error flag
+       @result Error
+*/
+typedef unsigned int Base64Flags;
+unsigned Base64EncodeEx(Base64Flags    inFlags);