[doc parsing]: make single character command impostures
warn in pedantic mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@181523 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/CommentCommandTraits.cpp b/lib/AST/CommentCommandTraits.cpp
index dc4744a..6baf4a9 100644
--- a/lib/AST/CommentCommandTraits.cpp
+++ b/lib/AST/CommentCommandTraits.cpp
@@ -68,6 +68,11 @@
const CommandInfo *
CommandTraits::getTypoCorrectCommandInfo(StringRef Typo) const {
+ // single character command impostures, such as \t or \n must not go
+ // through the fixit logic.
+ if (Typo.size() <= 1)
+ return NULL;
+
SmallVector<const CommandInfo *, 2> BestCommand;
int NumOfCommands = sizeof(Commands) / sizeof(CommandInfo);
diff --git a/lib/AST/CommentLexer.cpp b/lib/AST/CommentLexer.cpp
index c589219..b195d52 100644
--- a/lib/AST/CommentLexer.cpp
+++ b/lib/AST/CommentLexer.cpp
@@ -355,10 +355,6 @@
if (!Info) {
formTokenWithChars(T, TokenPtr, tok::unknown_command);
T.setUnknownCommandName(CommandName);
- // single character command impostures, such as \t or \n must not go
- // through the fixit logic.
- if (CommandName.size() <= 1)
- return;
if ((Info = Traits.getTypoCorrectCommandInfo(CommandName))) {
StringRef CorrectedName = Info->Name;
SourceRange CommandRange(T.getLocation().getLocWithOffset(1),