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
diff --git a/lib/AST/CommentParser.cpp b/lib/AST/CommentParser.cpp
index d053dc0..d0a8474 100644
--- a/lib/AST/CommentParser.cpp
+++ b/lib/AST/CommentParser.cpp
@@ -554,6 +554,14 @@
           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(),