<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On May 9, 2013, at 10:15 , Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">On Thu, May 9, 2013 at 8:03 PM, jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>> wrote:<br><blockquote type="cite"><br>On May 9, 2013, at 10:01 AM, Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com">gribozavr@gmail.com</a>> wrote:<br><br>On Thu, May 9, 2013 at 7:44 PM, Fariborz Jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>><br>wrote:<br><br>Author: fjahanian<br>Date: Thu May  9 11:44:02 2013<br>New Revision: 181521<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=181521&view=rev">http://llvm.org/viewvc/llvm-project?rev=181521&view=rev</a><br>Log:<br>[doc parsing]: So, in this patch, single character<br>'commands' will not go through typo fixit logic,<br>preserving the old behavior (no typo, no diagnostics).<br>// <a href="rdar://12381408">rdar://12381408</a><br><br>Modified:<br>  cfe/trunk/lib/AST/CommentCommandTraits.cpp<br>  cfe/trunk/lib/AST/CommentLexer.cpp<br><br>Modified: cfe/trunk/lib/AST/CommentCommandTraits.cpp<br>URL:<br><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentCommandTraits.cpp?rev=181521&r1=181520&r2=181521&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentCommandTraits.cpp?rev=181521&r1=181520&r2=181521&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/AST/CommentCommandTraits.cpp (original)<br>+++ cfe/trunk/lib/AST/CommentCommandTraits.cpp Thu May  9 11:44:02 2013<br>@@ -49,10 +49,6 @@ HelperTypoCorrectCommandInfo(SmallVector<br> const unsigned MaxEditDistance = 1;<br> unsigned BestEditDistance = MaxEditDistance + 1;<br> StringRef Name = Command->Name;<br>-  // Don't attempt trying to typo fix single character commands.<br>-  // \t and \n are very common<br>-  if (Name.size() <= 1)<br>-    return;<br><br> unsigned MinPossibleEditDistance = abs((int)Name.size() -<br>(int)Typo.size());<br> if (MinPossibleEditDistance > 0 &&<br><br>Modified: cfe/trunk/lib/AST/CommentLexer.cpp<br>URL:<br>http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentLexer.cpp?rev=181521&r1=181520&r2=181521&view=diff<br>==============================================================================<br>--- cfe/trunk/lib/AST/CommentLexer.cpp (original)<br>+++ cfe/trunk/lib/AST/CommentLexer.cpp Thu May  9 11:44:02 2013<br>@@ -355,6 +355,10 @@ void Lexer::lexCommentText(Token &T) {<br>       if (!Info) {<br>         formTokenWithChars(T, TokenPtr, tok::unknown_command);<br>         T.setUnknownCommandName(CommandName);<br>+          // single character command impostures, such as \t or \n must not<br>go<br>+          // through the fixit logic.<br>+          if (CommandName.size() <= 1)<br>+            return;<br><br><br>But it should still get a pedantic<br>diag::warn_unknown_comment_command_name diagnostic.<br><br><br>Are you sure. I intentionally left it out. It is going to be noisy with<br>pedantic.<br></blockquote><br>Pedantic is going to be noisy anyway, because it will warn even if<br>there is no typo correction available.  Pedantic should be, erm,<br>pedantic, and warn about everything suspect -- that's the intent.  It<br>is feasible to be pedantic-clean when starting a new project (like<br>clang codebase does), but for an existing project it will be noisy,<br>and that's why it is off by default.<br></div></blockquote><br></div><div>I definitely agree with Dmitri that pedantic has to really be pedantic, just like the regular -pedantic. If we're worried about noise we could add Yet Another Warning Flag under pedantic: -Wdocumentation-unknown-single-char-command or something.</div><br></body></html>