We actually used to assert on this.
Thanks to NAKAMURA Takumi for noticing this!
llvm-svn: 168277
def note_add_deprecation_attr : Note<
"add a deprecation attribute to the declaration to silence this warning">;
+// verbatim block commands
+
+def warn_verbatim_block_end_without_start : Warning<
+ "'\\%0' command does not terminate a verbatim text block">,
+ InGroup<Documentation>, DefaultIgnore;
+
} // end of documentation issue category
} // end of AST component
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(),
namespace test_returns_wrong_decl_10 { };
+// expected-warning@+1 {{'\endverbatim' command does not terminate a verbatim text block}}
+/// \endverbatim
+int test_verbatim_1();
+
+// expected-warning@+1 {{'\endcode' command does not terminate a verbatim text block}}
+/// \endcode
+int test_verbatim_2();
+
+// FIXME: we give a bad diagnostic here because we throw away non-documentation
+// comments early.
+//
+// expected-warning@+2 {{'\endcode' command does not terminate a verbatim text block}}
+/// \code
+// foo
+/// \endcode
+int test_verbatim_3();
+
+
// expected-warning@+1 {{empty paragraph passed to '\brief' command}}
int test1; ///< \brief\author Aaa