r235057 - Comment parsing: fix an assertion failure on a verbatim block terminated with "**/"

Dmitri Gribenko gribozavr at gmail.com
Wed Apr 15 16:45:44 PDT 2015


Author: gribozavr
Date: Wed Apr 15 18:45:43 2015
New Revision: 235057

URL: http://llvm.org/viewvc/llvm-project?rev=235057&view=rev
Log:
Comment parsing: fix an assertion failure on a verbatim block terminated with "**/"

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

Modified: cfe/trunk/lib/AST/CommentLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentLexer.cpp?rev=235057&r1=235056&r2=235057&view=diff
==============================================================================
--- cfe/trunk/lib/AST/CommentLexer.cpp (original)
+++ cfe/trunk/lib/AST/CommentLexer.cpp Wed Apr 15 18:45:43 2015
@@ -514,6 +514,12 @@ void Lexer::lexVerbatimBlockBody(Token &
   if (CommentState == LCS_InsideCComment)
     skipLineStartingDecorations();
 
+  if (BufferPtr == CommentEnd) {
+    formTokenWithChars(T, BufferPtr, tok::verbatim_block_line);
+    T.setVerbatimBlockText("");
+    return;
+  }
+
   lexVerbatimBlockFirstLine(T);
 }
 

Modified: cfe/trunk/test/Sema/warn-documentation.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/warn-documentation.cpp?rev=235057&r1=235056&r2=235057&view=diff
==============================================================================
--- cfe/trunk/test/Sema/warn-documentation.cpp (original)
+++ cfe/trunk/test/Sema/warn-documentation.cpp Wed Apr 15 18:45:43 2015
@@ -1038,6 +1038,12 @@ int test_nocrash12();
 ///@param x at param y
 int test_nocrash13(int x, int y);
 
+/**
+ * \verbatim
+ * Aaa
+ **/
+int test_nocrash14();
+
 // rdar://12379114
 // expected-warning at +2 {{'@union' command should not be used in a comment attached to a non-union declaration}}
 /*!





More information about the cfe-commits mailing list