History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 926 – 950 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 5eaa009e 13-Aug-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix incorrect lambda-detection.

Before:
[ a, a ]() -> a<1>{};

After:
[a, a]() -> a<1> {};

llvm-svn: 244890


# a804d1ec 11-Aug-2015 Daniel Jasper <djasper@google.com>

clang-format: Make SpaceBeforeParens work with overloaded operators.

Patch by Jon Chesterfield, thank you!

llvm-svn: 244660


# 291f64fd 10-Aug-2015 Roman Kashitsyn <romankashicin@gmail.com>

Add WebKit brace style configuration option.

Summary:
Add brace style `BS_WebKit` as described on https://www.webkit.org/coding/coding-style.html:

* Function definitions: place each brace on its ow

Add WebKit brace style configuration option.

Summary:
Add brace style `BS_WebKit` as described on https://www.webkit.org/coding/coding-style.html:

* Function definitions: place each brace on its own line.
* Other braces: place the open brace on the line preceding the code block; place the close brace on its own line.

Set brace style used in `getWebKitStyle()` to the newly added `BS_WebKit`.

Reviewers: djasper, klimek

Subscribers: klimek, cfe-commits

Differential Revision: http://reviews.llvm.org/D11837

llvm-svn: 244446

show more ...


Revision tags: llvmorg-3.7.0-rc2
# 9e321998 28-Jul-2015 Manuel Klimek <klimek@google.com>

Do not force linebreaks when MaxEmptyLinesToKeep is 0.

Previously we would format
call(

p);
as
call(
p);
with MaxEmptyLinesToKeep == 0.

Now we format it as:
call(p);

llvm-svn: 243429


# bcad0664 21-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix unary operator detection in for loops.

Before:
for (;; * a = b) {}

After:
for (;; *a = b) {}

llvm-svn: 242849


# e35c220c 20-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix crasher when a UTF8 character is found in an escape
sequence. Discovered by the fuzzer.

llvm-svn: 242738


# 352f0df4 18-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: Take nested lines into account when detection C++03
compatibility and variable alignment.

llvm-svn: 242611


# 3c44c220 16-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: Respect IndentWrappedFunctionNames when aligning colons

Before:
- (void)shortf:(GTMFoo *)theFoo
dontAlignNamef:(NSRect)theRect {
}

After:
- (void)shortf:(GTMFoo *)theFoo

clang-format: Respect IndentWrappedFunctionNames when aligning colons

Before:
- (void)shortf:(GTMFoo *)theFoo
dontAlignNamef:(NSRect)theRect {
}

After:
- (void)shortf:(GTMFoo *)theFoo
dontAlignNamef:(NSRect)theRect {
}

Patch by Kwasi Mensah, thank you!

llvm-svn: 242484

show more ...


Revision tags: llvmorg-3.7.0-rc1
# 525579d4 15-Jul-2015 Birunthan Mohanathas <birunthan@mohanathas.com>

clang-format: Fix return type breaking with overloaded operator functions

Differential Revision: http://reviews.llvm.org/D11177

llvm-svn: 242316


# 00fb2a11 15-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix column layout with a comment in the last line.

Before:
int aaaaa[] = {
1, 2,
3, // comment
4, 5,
6 // comment
};

After:
int aaaaa[] = {
1, 2,

clang-format: Fix column layout with a comment in the last line.

Before:
int aaaaa[] = {
1, 2,
3, // comment
4, 5,
6 // comment
};

After:
int aaaaa[] = {
1, 2, 3, // comment
4, 5, 6 // comment
};

llvm-svn: 242299

show more ...


# ea40cee2 14-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix formatting of multiple lambdas in initializers.

Before:
SomeFunction({[&] {
// comment
},
[&] {
// comment
}});

After:

clang-format: Fix formatting of multiple lambdas in initializers.

Before:
SomeFunction({[&] {
// comment
},
[&] {
// comment
}});

After:
SomeFunction({[&] {
// comment
},
[&] {
// comment
}});

llvm-svn: 242138

show more ...


# 305fa9c2 12-Jul-2015 Birunthan Mohanathas <birunthan@mohanathas.com>

clang-format: Add Mozilla brace breaking style

Differential Revision: http://reviews.llvm.org/D10883

llvm-svn: 241986


# 3bacc4df 07-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: Break after "for (" less eagerly.

Before:
for (
auto aaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
aaaaaaaaaaaaaaaaaaaaaaaaaaa != bbbbbbbbbbbbbb

clang-format: Break after "for (" less eagerly.

Before:
for (
auto aaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
aaaaaaaaaaaaaaaaaaaaaaaaaaa != bbbbbbbbbbbbbbbbbbbbbbb;
++aaaaaaaaaaaaaaaaaaaaaaaaaaa) {

After:
for (auto aaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa);
aaaaaaaaaaaaaaaaaaaaaaaaaaa != bbbbbbbbbbbbbbbbbbbbbbb;
++aaaaaaaaaaaaaaaaaaaaaaaaaaa) {

llvm-svn: 241601

show more ...


# b9edcfb0 07-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: Don't wrap before the ] of a lambda introducer.

Before:
return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([=
](int iiiiiiiiiiii) {
return aaaaaaaaaaaaaaaaaaaaaaa != aaaaaaaaaaaaaaaaaaaaaaa

clang-format: Don't wrap before the ] of a lambda introducer.

Before:
return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([=
](int iiiiiiiiiiii) {
return aaaaaaaaaaaaaaaaaaaaaaa != aaaaaaaaaaaaaaaaaaaaaaa;
});

After:
return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa([=](
int iiiiiiiiiiii) {
return aaaaaaaaaaaaaaaaaaaaaaa != aaaaaaaaaaaaaaaaaaaaaaa;
});

llvm-svn: 241583

show more ...


# a5fa4d1d 06-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix __attribute__ being treated as decl name.

__attribute__ was treated as the name of a function definition, with the
tokens in parentheses being the parameter list. This formats inco

clang-format: Fix __attribute__ being treated as decl name.

__attribute__ was treated as the name of a function definition, with the
tokens in parentheses being the parameter list. This formats incorrectly
with AlwaysBreakAfterDefinitionReturnType. Fix it by treating
__attribute__ like decltype.

Patch by Strager Neds, thank you.

llvm-svn: 241439

show more ...


# b001a0ba 03-Jul-2015 Birunthan Mohanathas <birunthan@mohanathas.com>

clang-format: Add MacroBlock{Begin,End} options

The MacroBlockBegin and MacroBlockEnd options make matching macro identifiers
behave like '{' and '}', respectively, in terms of indentation.

Mozilla

clang-format: Add MacroBlock{Begin,End} options

The MacroBlockBegin and MacroBlockEnd options make matching macro identifiers
behave like '{' and '}', respectively, in terms of indentation.

Mozilla code, for example, uses several macros that begin and end a scope.
Previously, Clang-Format removed the indentation resulting in:

MACRO_BEGIN(...)
MACRO_ENTRY(...)
MACRO_ENTRY(...)
MACRO_END

Now, using the options

MacroBlockBegin: "^[A-Z_]+_BEGIN$"
MacroBlockEnd: "^[A-Z_]+_END$"

will yield the expected result:

MACRO_BEGIN(...)
MACRO_ENTRY(...)
MACRO_ENTRY(...)
MACRO_END

Differential Revision: http://reviews.llvm.org/D10840

llvm-svn: 241363

show more ...


# 3992e2c7 01-Jul-2015 Daniel Jasper <djasper@google.com>

clang-format: Support member function reference qualifiers with
trailing return types.

Before:
template <typename T>
auto x() & -> int {}

After:
template <typename T>
auto x() & -> int

clang-format: Support member function reference qualifiers with
trailing return types.

Before:
template <typename T>
auto x() & -> int {}

After:
template <typename T>
auto x() & -> int {}

llvm-svn: 241188

show more ...


# a87af7a3 30-Jun-2015 Daniel Jasper <djasper@google.com>

clang-format: Properly parse parenthesis in braced lists.

Among other things, this makes clang-format understand arbitrary blocks
embedded in them, such as:

SomeFunction({MACRO({ return output; }

clang-format: Properly parse parenthesis in braced lists.

Among other things, this makes clang-format understand arbitrary blocks
embedded in them, such as:

SomeFunction({MACRO({ return output; }), b});

where MACRO could e.g. expand to a lambda.

llvm-svn: 241059

show more ...


# a0388a8a 29-Jun-2015 Birunthan Mohanathas <birunthan@mohanathas.com>

clang-format: Add option to break after definition return type for top-level functions only

Differential Revision: http://reviews.llvm.org/D10774

llvm-svn: 240959


# 739b85f2 29-Jun-2015 Daniel Jasper <djasper@google.com>

clang-format: Don't indent relative to unary operators (some more).

Before:
long aaaaaaaa = !aaaa( // break
aaaaaa);
long aaaaaaaa = !aa.aa( // break
aaaaaa);

After:

clang-format: Don't indent relative to unary operators (some more).

Before:
long aaaaaaaa = !aaaa( // break
aaaaaa);
long aaaaaaaa = !aa.aa( // break
aaaaaa);

After:
long aaaaaaaa = !aaaa( // break
aaaaaa);
long aaaaaaaa = !aa.aa( // break
aaaaaa);

llvm-svn: 240934

show more ...


# 45c48128 28-Jun-2015 Nico Weber <nicolasweber@gmx.de>

clang-format: Support @autoreleasepool.

Format @autoreleasepool properly for the Attach brace style
by recognizing @autoreleasepool as a block introducer.

Patch from Strager Neds!
http://reviews.ll

clang-format: Support @autoreleasepool.

Format @autoreleasepool properly for the Attach brace style
by recognizing @autoreleasepool as a block introducer.

Patch from Strager Neds!
http://reviews.llvm.org/D10372

llvm-svn: 240896

show more ...


Revision tags: llvmorg-3.6.2, llvmorg-3.6.2-rc1
# 9fb676a2 19-Jun-2015 Daniel Jasper <djasper@google.com>

clang-format: Make exception to AlwaysBreakBeforeMultilineStrings more
conservative.

In particular, this fixes an unwanted corner case.

Before:
string s =
someFunction("aaaa"

clang-format: Make exception to AlwaysBreakBeforeMultilineStrings more
conservative.

In particular, this fixes an unwanted corner case.

Before:
string s =
someFunction("aaaa"
"bbbb");

After:
string s = someFunction(
"aaaa"
"bbbb");

llvm-svn: 240129

show more ...


# b5a0b854 19-Jun-2015 Daniel Jasper <djasper@google.com>

clang-format: Better fix to detect elaborated enum return types.

The previous one (r240021) regressed:
enum E Type::f() { .. }

llvm-svn: 240127


# 1bf729ce 18-Jun-2015 Daniel Jasper <djasper@google.com>

clang-format: Row back on the AlwaysBreakBeforeMultilineStrings change.

It was a bit too aggressive.

With this patch, we keep on breaking here:
aaaaaaaaaaaaa(aaaaaaa,
"aaaaaaa"

clang-format: Row back on the AlwaysBreakBeforeMultilineStrings change.

It was a bit too aggressive.

With this patch, we keep on breaking here:
aaaaaaaaaaaaa(aaaaaaa,
"aaaaaaa"
"bbbbbbb");

But don't break in:
aaaaaaaaaaaaa(aaaaaaa, aaaaaaaa("aaaaaaa"
"bbbbbbb"));

llvm-svn: 240024

show more ...


# 47721ac7 18-Jun-2015 Daniel Jasper <djasper@google.com>

clang-format: Better support functions with elaborated enum return types.

Before, this wasn't formatted properly:
enum ::C f() {
return a;
}

llvm-svn: 240021


1...<<31323334353637383940>>...82