[cfe-commits] r160474 - in /cfe/trunk: lib/AST/Comment.cpp test/Sema/warn-documentation.cpp

Dmitri Gribenko gribozavr at gmail.com
Wed Jul 18 17:01:56 PDT 2012


Author: gribozavr
Date: Wed Jul 18 19:01:56 2012
New Revision: 160474

URL: http://llvm.org/viewvc/llvm-project?rev=160474&view=rev
Log:
Fix ParagraphComment::isWhitespace(): a paragraph without a non-whitespace
TextComment node was considered whitespace even if it contained other child
nodes.

Modified:
    cfe/trunk/lib/AST/Comment.cpp
    cfe/trunk/test/Sema/warn-documentation.cpp

Modified: cfe/trunk/lib/AST/Comment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Comment.cpp?rev=160474&r1=160473&r2=160474&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Comment.cpp (original)
+++ cfe/trunk/lib/AST/Comment.cpp Wed Jul 18 19:01:56 2012
@@ -116,7 +116,8 @@
     if (const TextComment *TC = dyn_cast<TextComment>(*I)) {
       if (!TC->isWhitespace())
         return false;
-    }
+    } else
+      return false;
   }
   return true;
 }

Modified: cfe/trunk/test/Sema/warn-documentation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-documentation.cpp?rev=160474&r1=160473&r2=160474&view=diff
==============================================================================
--- cfe/trunk/test/Sema/warn-documentation.cpp (original)
+++ cfe/trunk/test/Sema/warn-documentation.cpp Wed Jul 18 19:01:56 2012
@@ -104,6 +104,9 @@
 /// \brief Aaa
 int test_block_command5(int);
 
+/// \brief \c Aaa
+int test_block_command6(int);
+
 // expected-warning at +1 {{'\param' command used in a comment that is not attached to a function declaration}}
 /// \param a Blah blah.
 int test_param1;





More information about the cfe-commits mailing list