r176448 - [comment parsing] source fidelity for tparam command too.

Fariborz Jahanian fjahanian at apple.com
Mon Mar 4 12:08:47 PST 2013


Author: fjahanian
Date: Mon Mar  4 14:08:47 2013
New Revision: 176448

URL: http://llvm.org/viewvc/llvm-project?rev=176448&view=rev
Log:
[comment parsing] source fidelity for tparam command too.
// rdar://13066276

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

Modified: cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td?rev=176448&r1=176447&r2=176448&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td Mon Mar  4 14:08:47 2013
@@ -87,10 +87,10 @@ def warn_doc_param_not_found : Warning<
 def note_doc_param_name_suggestion : Note<
   "did you mean '%0'?">;
 
-// \tparam command
+// tparam command
 
 def warn_doc_tparam_not_attached_to_a_template_decl : Warning<
-  "'\\tparam' command used in a comment that is not attached to "
+  "'%select{\\|@}0tparam' command used in a comment that is not attached to "
   "a template declaration">,
   InGroup<Documentation>, DefaultIgnore;
 

Modified: cfe/trunk/lib/AST/CommentSema.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentSema.cpp?rev=176448&r1=176447&r2=176448&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CommentSema.cpp (original)
+++ cfe/trunk/lib/AST/CommentSema.cpp Mon Mar  4 14:08:47 2013
@@ -173,6 +173,7 @@ TParamCommandComment *Sema::actOnTParamC
   if (!isTemplateOrSpecialization())
     Diag(Command->getLocation(),
          diag::warn_doc_tparam_not_attached_to_a_template_decl)
+      << AtCommand
       << Command->getCommandNameRange(Traits);
 
   return Command;

Modified: cfe/trunk/test/Sema/warn-documentation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-documentation.cpp?rev=176448&r1=176447&r2=176448&view=diff
==============================================================================
--- cfe/trunk/test/Sema/warn-documentation.cpp (original)
+++ cfe/trunk/test/Sema/warn-documentation.cpp Mon Mar  4 14:08:47 2013
@@ -799,6 +799,10 @@ void test_attach37<int>::test_attach38(i
 template<typename T>
 void test_attach37<T>::test_attach39(int aaa, int bbb) {}
 
+// expected-warning at +1 {{'@tparam' command used in a comment that is not attached to a template declaration}}
+/// @tparam T Aaa
+int test_tparam22;
+
 // We used to emit warning that parameter 'a' is not found because we parsed
 // the comment in context of the redeclaration which does not have parameter
 // names.





More information about the cfe-commits mailing list