]> granicus.if.org Git - clang/commitdiff
Comment parsing: fix an assertion failure on a verbatim block terminated with "**/"
authorDmitri Gribenko <gribozavr@gmail.com>
Wed, 15 Apr 2015 23:45:43 +0000 (23:45 +0000)
committerDmitri Gribenko <gribozavr@gmail.com>
Wed, 15 Apr 2015 23:45:43 +0000 (23:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235057 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/CommentLexer.cpp
test/Sema/warn-documentation.cpp

index 06a08bdad45fd8143ac93b1f717e47f200fb39a5..98b7e367950c16b8d8d8687d2bb15bf827419d20 100644 (file)
@@ -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);
 }
 
index 4375cfcf560a31a1fb2ef8ce0f297f3fcf025d83..5d866359aa75f0222531c2ce2cfc058b1b007a2b 100644 (file)
@@ -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}}
 /*!