From 0321b8ffd6de8c6fda99cc3daeb08d33fe8ff03e Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Thu, 9 May 2013 17:18:52 +0000 Subject: [doc parsing]: make single character command impostures warn in pedantic mode. llvm-svn: 181523 --- clang/lib/AST/CommentCommandTraits.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'clang/lib/AST/CommentCommandTraits.cpp') diff --git a/clang/lib/AST/CommentCommandTraits.cpp b/clang/lib/AST/CommentCommandTraits.cpp index dc4744a..6baf4a9 100644 --- a/clang/lib/AST/CommentCommandTraits.cpp +++ b/clang/lib/AST/CommentCommandTraits.cpp @@ -68,6 +68,11 @@ HelperTypoCorrectCommandInfo(SmallVectorImpl &BestCommand, 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 BestCommand; int NumOfCommands = sizeof(Commands) / sizeof(CommandInfo); -- cgit v1.1