From: Dmitri Gribenko Date: Wed, 15 Apr 2015 23:45:43 +0000 (+0000) Subject: Comment parsing: fix an assertion failure on a verbatim block terminated with "**/" X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e7a01ec88cfe5b97f731db758615b66a6264440f;p=clang Comment parsing: fix an assertion failure on a verbatim block terminated with "**/" git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235057 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/CommentLexer.cpp b/lib/AST/CommentLexer.cpp index 06a08bdad4..98b7e36795 100644 --- a/lib/AST/CommentLexer.cpp +++ b/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/test/Sema/warn-documentation.cpp b/test/Sema/warn-documentation.cpp index 4375cfcf56..5d866359aa 100644 --- a/test/Sema/warn-documentation.cpp +++ b/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}} /*!