From 858e69fe1305bdffb76a200c0f498685f11e65ae Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Thu, 19 Jul 2012 00:01:56 +0000 Subject: [PATCH] Fix ParagraphComment::isWhitespace(): a paragraph without a non-whitespace TextComment node was considered whitespace even if it contained other child nodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160474 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/Comment.cpp | 3 ++- test/Sema/warn-documentation.cpp | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/AST/Comment.cpp b/lib/AST/Comment.cpp index f3f4d9bf16..82dbed47f8 100644 --- a/lib/AST/Comment.cpp +++ b/lib/AST/Comment.cpp @@ -116,7 +116,8 @@ bool ParagraphComment::isWhitespaceNoCache() const { if (const TextComment *TC = dyn_cast(*I)) { if (!TC->isWhitespace()) return false; - } + } else + return false; } return true; } diff --git a/test/Sema/warn-documentation.cpp b/test/Sema/warn-documentation.cpp index f12871856b..aec914a7cd 100644 --- a/test/Sema/warn-documentation.cpp +++ b/test/Sema/warn-documentation.cpp @@ -104,6 +104,9 @@ int test_block_command4(int); /// \brief Aaa int test_block_command5(int); +/// \brief \c Aaa +int test_block_command6(int); + // expected-warning@+1 {{'\param' command used in a comment that is not attached to a function declaration}} /// \param a Blah blah. int test_param1; -- 2.50.1