aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/CommentParser.cpp
diff options
context:
space:
mode:
authorDmitri Gribenko <gribozavr@gmail.com>2012-11-18 00:30:31 +0000
committerDmitri Gribenko <gribozavr@gmail.com>2012-11-18 00:30:31 +0000
commit36cbbe916f66f08d36492e75809fbf54416a5e8d (patch)
treed13331699325b3e99a00f73bb5c1a9ad5f6587c4 /lib/AST/CommentParser.cpp
parentd9ffa0c39ff9c71e2729eac4cdcf32b377c1d3b6 (diff)
Documentation parsing: propely handle a lone '\endverbatim' and emit a warning.
We actually used to assert on this. Thanks to NAKAMURA Takumi for noticing this! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168277 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/CommentParser.cpp')
-rw-r--r--lib/AST/CommentParser.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/AST/CommentParser.cpp b/lib/AST/CommentParser.cpp
index d053dc0f18..d0a84741b6 100644
--- a/lib/AST/CommentParser.cpp
+++ b/lib/AST/CommentParser.cpp
@@ -554,6 +554,14 @@ BlockContentComment *Parser::parseParagraphOrBlockCommand() {
return parseBlockCommand();
break; // Block command ahead, finish this parapgaph.
}
+ if (Info->IsVerbatimBlockEndCommand) {
+ Diag(Tok.getLocation(),
+ diag::warn_verbatim_block_end_without_start)
+ << Info->Name
+ << SourceRange(Tok.getLocation(), Tok.getEndLocation());
+ consumeToken();
+ continue;
+ }
if (Info->IsUnknownCommand) {
Content.push_back(S.actOnUnknownCommand(Tok.getLocation(),
Tok.getEndLocation(),