summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/AST/CommentLexer.cpp6
-rw-r--r--clang/test/Sema/warn-documentation.cpp6
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/lib/AST/CommentLexer.cpp b/clang/lib/AST/CommentLexer.cpp
index 06a08bdad45..98b7e367950 100644
--- a/clang/lib/AST/CommentLexer.cpp
+++ b/clang/lib/AST/CommentLexer.cpp
@@ -514,6 +514,12 @@ void Lexer::lexVerbatimBlockBody(Token &T) {
if (CommentState == LCS_InsideCComment)
skipLineStartingDecorations();
+ if (BufferPtr == CommentEnd) {
+ formTokenWithChars(T, BufferPtr, tok::verbatim_block_line);
+ T.setVerbatimBlockText("");
+ return;
+ }
+
lexVerbatimBlockFirstLine(T);
}
diff --git a/clang/test/Sema/warn-documentation.cpp b/clang/test/Sema/warn-documentation.cpp
index 4375cfcf560..5d866359aa7 100644
--- a/clang/test/Sema/warn-documentation.cpp
+++ b/clang/test/Sema/warn-documentation.cpp
@@ -1038,6 +1038,12 @@ int test_nocrash12();
///@param x@param y
int test_nocrash13(int x, int y);
+/**
+ * \verbatim
+ * Aaa
+ **/
+int test_nocrash14();
+
// rdar://12379114
// expected-warning@+2 {{'@union' command should not be used in a comment attached to a non-union declaration}}
/*!
OpenPOWER on IntegriCloud