r195954 - clang-format: Extends formatted ranges to subsequent lines comments.

Alp Toker alp at nuanti.com
Mon Dec 2 00:52:09 PST 2013


On 02/12/2013 08:24, Daniel Jasper wrote:
> I just tried reproducing this and it still works fine here (both in 
> vim and in emacs). Are you sure that clang-format removes that 
> trailing whitespace?

Hi Daniel,

I think Rafael is onto something.

If you take a look at r196038 in clang-tools-extra, there's an unrelated 
whitespace fix that slipped into the commit yesterday:


|@@ -262,7 +262,7 @@ StatementMatcher makePseudoArrayLoopMatcher() {||
||   // Test that the incoming type has a record declaration that has 
methods||
||   // called 'begin' and 'end'. If the incoming type is const, then 
make sure||
||   // these methods are also marked const.||
||-  // ||
||+  //||
||   // FIXME: To be completely thorough this matcher should also ensure 
the||
||   // return type of begin/end is an iterator that dereferences to the 
same as||
||   // what operator[] or at() returns. Such a test isn't likely to 
fail except|

The line that was legitimately changed is a fair bit above so I wouldn't 
have expected to see this edit to an untouched line.

I can try re-creating the patch as it was before running clang-format if 
it'd be any help.

diff -U0 | clang-format-diff.py -p1 -i

Alp.


>
>
> On Sun, Dec 1, 2013 at 7:01 PM, Rafael EspĂ­ndola 
> <rafael.espindola at gmail.com <mailto:rafael.espindola at gmail.com>> wrote:
>
>     This seems to have caused a regression with at least the emacs
>     integration. Running clang-format-region now seems to remove trailing
>     white space from unrelated areas. For example, run it with the cursor
>     in Sema.cpp:1112:
>
>       if (!LangOpts.RetainCommentsFromSystemHeaders &&
>
>     and the trailing white space in Sema.cpp:1100:
>
>     // We have a generic lambda if we parsed auto parameters, or we have
>
>     is removed.
>
>     Cheers,
>     Rafael
>
>
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-- 
http://www.nuanti.com
the browser experts

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131202/316485ac/attachment.html>


More information about the cfe-commits mailing list