Re: [PATCH] D19058: clang-format: Pointer `*` is seen as multiplication in C-style casts

2016-04-14 Thread Maxime Beaulieu via cfe-commits
mxbOctasic updated this revision to Diff 53755. mxbOctasic added a comment. Moved cast detection logic to `rParenEndsCast`. http://reviews.llvm.org/D19058 Files: lib/Format/TokenAnnotator.cpp unittests/Format/FormatTest.cpp Index: unittests/Format/FormatTest.cpp ===

Re: [PATCH] D19069: clang-format: Fixed various brace wrapping and block merging bugs

2016-04-14 Thread Maxime Beaulieu via cfe-commits
mxbOctasic added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:789-790 @@ -773,4 +788,4 @@ if (FormatTok->Tok.is(tok::l_brace)) { -if (Style.BraceWrapping.AfterObjCDeclaration) - addUnwrappedLine(); +CompoundStatementIndenter Inden

Re: [PATCH] D19063: clang-format: Fixed line merging of more than two lines

2016-04-13 Thread Maxime Beaulieu via cfe-commits
mxbOctasic added inline comments. Comment at: unittests/Format/FormatTest.cpp:285 @@ +284,3 @@ + + EXPECT_EQ("class Foo\n" +"{\n" djasper wrote: > How does this break? I generally add an Before and After of one of the test > cases into my patch descr

Re: [PATCH] D19064: clang-format: Allow include of clangFormat.h in managed context

2016-04-13 Thread Maxime Beaulieu via cfe-commits
mxbOctasic updated this revision to Diff 53608. mxbOctasic added a comment. Removed empty line. http://reviews.llvm.org/D19064 Files: include/clang/Format/Format.h lib/Format/Format.cpp Index: lib/Format/Format.cpp === --- lib

Re: [PATCH] D19069: clang-format: Fixed various brace wrapping and block merging bugs

2016-04-13 Thread Maxime Beaulieu via cfe-commits
mxbOctasic added inline comments. Comment at: lib/Format/UnwrappedLineParser.cpp:789-790 @@ -773,4 +788,4 @@ if (FormatTok->Tok.is(tok::l_brace)) { -if (Style.BraceWrapping.AfterObjCDeclaration) - addUnwrappedLine(); +CompoundStatementIndenter Inden

[PATCH] D19069: clang-format: Fixed various brace wrapping and block merging bugs

2016-04-13 Thread Maxime Beaulieu via cfe-commits
mxbOctasic created this revision. mxbOctasic added a reviewer: djasper. mxbOctasic added subscribers: cameron314, cfe-commits. Herald added a subscriber: klimek. Multiple brace wrapping flag combination were broken. First, IndentBraces + !AfterControlStatement caused the whole If-Else construct

[PATCH] D19066: clang-format: `SpaceAfterTemplate` and `SpacesInBraces` options

2016-04-13 Thread Maxime Beaulieu via cfe-commits
mxbOctasic created this revision. mxbOctasic added a reviewer: djasper. mxbOctasic added subscribers: cameron314, cfe-commits. Herald added a subscriber: klimek. This patch adds two new spacing options. `SpaceAfterTemplate` inserts a space between the template keyword and the opening chevron. `

[PATCH] D19063: clang-format: Fixed line merging of more than two lines

2016-04-13 Thread Maxime Beaulieu via cfe-commits
mxbOctasic created this revision. mxbOctasic added a reviewer: djasper. mxbOctasic added subscribers: cameron314, cfe-commits. Herald added a subscriber: klimek. `getNextMergedLine` merged pairs of adjacent lines instead of merging them all with the first one. Consider `AnnotatedLine` `A`, `B` a

[PATCH] D19064: clang-format: Allow include of clangFormat.h in managed context

2016-04-13 Thread Maxime Beaulieu via cfe-commits
mxbOctasic created this revision. mxbOctasic added a reviewer: djasper. mxbOctasic added subscribers: cameron314, cfe-commits. Herald added a subscriber: klimek. Including `VirtualFileSystem.h` in the clangFormat.h indirectly includes ``. This header is blocked when compiling with /clr. I added a

[PATCH] D19065: clang-format: Last line in incomplete block is indented incorrectly

2016-04-13 Thread Maxime Beaulieu via cfe-commits
mxbOctasic created this revision. mxbOctasic added a reviewer: djasper. mxbOctasic added subscribers: cameron314, cfe-commits. Herald added a subscriber: klimek. This bug occurred when the end of the file was reached while parsing a block. The indentation of the last line was reset to the initial

[PATCH] D19058: clang-format: Pointer `*` is seen as multiplication in C-style casts

2016-04-13 Thread Maxime Beaulieu via cfe-commits
mxbOctasic created this revision. mxbOctasic added a reviewer: djasper. mxbOctasic added subscribers: cameron314, cfe-commits. Herald added a subscriber: klimek. The `*` was treated as multiplication operator in complex pointer type casts. e.g. (type *const)bar (type *restrict)bar Patch by came