summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/CommentCommandTraits.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-05-09 17:18:52 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-05-09 17:18:52 +0000
commit0321b8ffd6de8c6fda99cc3daeb08d33fe8ff03e (patch)
treec65598c13e072965da3897a0585321506e40021d /clang/lib/AST/CommentCommandTraits.cpp
parentfc4f7dc0a6d3fe4e40eb0ac52f17ab1d9dc48ee6 (diff)
downloadbcm5719-llvm-0321b8ffd6de8c6fda99cc3daeb08d33fe8ff03e.tar.gz
bcm5719-llvm-0321b8ffd6de8c6fda99cc3daeb08d33fe8ff03e.zip
[doc parsing]: make single character command impostures
warn in pedantic mode. llvm-svn: 181523
Diffstat (limited to 'clang/lib/AST/CommentCommandTraits.cpp')
-rw-r--r--clang/lib/AST/CommentCommandTraits.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/AST/CommentCommandTraits.cpp b/clang/lib/AST/CommentCommandTraits.cpp
index dc4744a53c5..6baf4a9dc6b 100644
--- a/clang/lib/AST/CommentCommandTraits.cpp
+++ b/clang/lib/AST/CommentCommandTraits.cpp
@@ -68,6 +68,11 @@ HelperTypoCorrectCommandInfo(SmallVectorImpl<const CommandInfo *> &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<const CommandInfo *, 2> BestCommand;
int NumOfCommands = sizeof(Commands) / sizeof(CommandInfo);
OpenPOWER on IntegriCloud