History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 1026 – 1050 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 53395406 07-Apr-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix regression formatting QT's "signals:" from r234318.

llvm-svn: 234320


# 676e5163 07-Apr-2015 Daniel Jasper <djasper@google.com>

clang-format: Don't allow labels when expecting declarations.

This fixes formatting unnamed bitfields (llvm.org/PR21999).

Before:
struct MyStruct {
uchar data;
uchar:
8;
uchar:
8;

clang-format: Don't allow labels when expecting declarations.

This fixes formatting unnamed bitfields (llvm.org/PR21999).

Before:
struct MyStruct {
uchar data;
uchar:
8;
uchar:
8;
uchar other;
};

After:
struct MyStruct {
uchar data;
uchar : 8;
uchar : 8;
uchar other;
};

llvm-svn: 234318

show more ...


# acf67e3e 07-Apr-2015 Daniel Jasper <djasper@google.com>

clang-format: Improve nested block formatting.

Before:
functionA(functionB({
int i;
int j;
}),
aaaa, bbbb, cccc);

After:
functionA(functionB({
int i;

clang-format: Improve nested block formatting.

Before:
functionA(functionB({
int i;
int j;
}),
aaaa, bbbb, cccc);

After:
functionA(functionB({
int i;
int j;
}),
aaaa, bbbb, cccc);

llvm-svn: 234304

show more ...


# 9dedc775 07-Apr-2015 Daniel Jasper <djasper@google.com>

clang-format: Indent relative to the ./-> and not the function name.

Before:
aaaaaaaaaaa //
.aaaa( //
bbbb) // This is different ..
.aaaa( //
cccc);

clang-format: Indent relative to the ./-> and not the function name.

Before:
aaaaaaaaaaa //
.aaaa( //
bbbb) // This is different ..
.aaaa( //
cccc); // .. from this.

After:
aaaaaaaaaaa //
.aaaa( //
bbbb) // This is identical ..
.aaaa( //
cccc); // .. to this.

llvm-svn: 234300

show more ...


# 05cd9292 26-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Force line break in trailing calls after multline exprs.

Before:
aaaaaaaa(aaaaaaaaaa,
bbbbbbbbbb).a();

After:
aaaaaaaa(aaaaaaaaaa,
bbbbbbbbbb)
.a();

l

clang-format: Force line break in trailing calls after multline exprs.

Before:
aaaaaaaa(aaaaaaaaaa,
bbbbbbbbbb).a();

After:
aaaaaaaa(aaaaaaaaaa,
bbbbbbbbbb)
.a();

llvm-svn: 233304

show more ...


# e99c72fc 26-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix merging of _T macros.

NewlinesBefore and HasUnescapedNewline were not properly propagated
leading to llvm.org/PR23032.

llvm-svn: 233276


# 414c9c6f 19-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix another bug in wrapping around "*".

Before:
void aaaaa(
aaaaaaaaaaaa* aaaaaaaaaaaaaa) {} // even violation the column limit

After:
void aaaaa(aaaaaaaaaaaa*

clang-format: Fix another bug in wrapping around "*".

Before:
void aaaaa(
aaaaaaaaaaaa* aaaaaaaaaaaaaa) {} // even violation the column limit

After:
void aaaaa(aaaaaaaaaaaa*
aaaaaaaaaaaaaa) {}

llvm-svn: 232717

show more ...


# 11309819 18-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix bad wrapping after "*" introduced in r232044.

Before:
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa*
const a

clang-format: Fix bad wrapping after "*" introduced in r232044.

Before:
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaa*
const aaaaaaaaaaaa) {}

After:
void aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
aaaaaaaaaaaaaaaaaaaaaaaaa* const aaaaaaaaaaaa) {}

llvm-svn: 232635

show more ...


# 92e09829 18-Mar-2015 Daniel Jasper <djasper@google.com>

[clang-format] Add missing test for std::function<void( int, int )>
spacing also fixed by r230473.

The fix in r230473 was done to enable fixing the spacing for
std::function<void( int, int )>.
I d

[clang-format] Add missing test for std::function<void( int, int )>
spacing also fixed by r230473.

The fix in r230473 was done to enable fixing the spacing for
std::function<void( int, int )>.
I did not realized that it also fixed this
issue. Since it is fairly different from
Deleted &operator=(const Deleted &)& = default;
fixed in r230473, it seems sensible to add the regression test for it.

Also cleaned up the test by removing duplicated code and comment, and kept
repeated test set consistent.

Result of running the new tests with r230473 backed out:
[ RUN ] FormatTest.ConfigurableSpacesInParentheses
Actual: "std::function<void(int, int)> callback;"
Expected: "std::function<void( int, int )> callback;"
Actual: "std::function<void( int, int )> callback;"
Expected: "std::function<void(int, int)> callback;"
Actual: "std::function<void( int, int ) > callback;"
Expected: "std::function<void(int, int)> callback;"
[ FAILED ] FormatTest.ConfigurableSpacesInParentheses (402 ms)

Result of new tests with r230473:
[ RUN ] FormatTest.ConfigurableSpacesInParentheses
[ OK ] FormatTest.ConfigurableSpacesInParentheses (209 ms)

Review: http://reviews.llvm.org/D7922

Patch by Jean-Philippe Dufraigne. Thanks!

llvm-svn: 232632

show more ...


Revision tags: llvmorg-3.5.2, llvmorg-3.5.2-rc1
# 9ecb0e96 13-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Don't corrupt macros with open braces.

Formatting:
#define A { {
#define B } }

Before:
#define A \
{ \
{ #define B } \
}

A

clang-format: Don't corrupt macros with open braces.

Formatting:
#define A { {
#define B } }

Before:
#define A \
{ \
{ #define B } \
}

After:
#define A \
{ \
{
#define B \
} \
}

This fixes llvm.org/PR22884.

llvm-svn: 232166

show more ...


# 55ca608c 12-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: [OBJC] Don't indent 8 spaces in method declarations.

Before:
- (void)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
(SoooooooooooooooooooooomeType *)bbbbbbbbbb;

After:
- (void

clang-format: [OBJC] Don't indent 8 spaces in method declarations.

Before:
- (void)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
(SoooooooooooooooooooooomeType *)bbbbbbbbbb;

After:
- (void)aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:
(SoooooooooooooooooooooomeType *)bbbbbbbbbb;

llvm-svn: 232112

show more ...


# b754a747 12-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: When putting */& next to types, also wrap before them.

Before:
LoooooooooooongType *
loooooooooooongVariable;

After:
LoooooooooooongType
*loooooooooooongVariable;

llv

clang-format: When putting */& next to types, also wrap before them.

Before:
LoooooooooooongType *
loooooooooooongVariable;

After:
LoooooooooooongType
*loooooooooooongVariable;

llvm-svn: 232044

show more ...


# dc4f7256 11-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix incorrect && recognition.

Before:
if (a &&(b = c)) ..

After:
if (a && (b = c)) ..

llvm-svn: 231920


# ac5c97e3 09-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Don't remove newline if macro ends in access specifier.

I.e.:

#define A public:

// The new line before this line would be removed.
int a;

llvm-svn: 231636


# 98f8ae34 06-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Slightly change indentation rules in for loops.

There was already a TODO to double-check whether the extra indenation
makes sense. A slightly different case reveals that it is actively

clang-format: Slightly change indentation rules in for loops.

There was already a TODO to double-check whether the extra indenation
makes sense. A slightly different case reveals that it is actively harmful:

for (int i = 0; i < aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
bbbbbbbbbbbbbbbbbbbb < ccccccccccccccc;
++i) {
}

Here (and it is probably not a totally infrequent case, it just works out that
"i < " is four spaces and so the four space extra indentation makes the
operator precedence confusing. So, this will now instead be formatted
as:

for (int i = 0; i < aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ||
bbbbbbbbbbbbbbbbbbbb < ccccccccccccccc;
++i) {
}

llvm-svn: 231461

show more ...


# 0391e556 03-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix access to uninitialized memory.

With incomplete code, we aren't guaranteed to generated changes for
every token. In that case, we need to assume that even the very first
change can

clang-format: Fix access to uninitialized memory.

With incomplete code, we aren't guaranteed to generated changes for
every token. In that case, we need to assume that even the very first
change can continue a preprocessor directive and initialize values
accordingly.

llvm-svn: 231066

show more ...


# e6623169 02-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Prefer wrapping a lambda's body over the lambda's return type.

Before:
aaaaaaaaaaaaaaaaaaaaaa(
[](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa)
-> aaaaaaaaaaaaaaaaaaaaa { re

clang-format: Prefer wrapping a lambda's body over the lambda's return type.

Before:
aaaaaaaaaaaaaaaaaaaaaa(
[](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa)
-> aaaaaaaaaaaaaaaaaaaaa { return aaaaaaaaaaaaaaaaa; });

After:
aaaaaaaaaaaaaaaaaaaaaa(
[](aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa &aaa) -> aaaaaaaaaaaaaaaaaaaaa {
return aaaaaaaaaaaaaaaaa;
});

llvm-svn: 230942

show more ...


# bea1ab46 01-Mar-2015 Daniel Jasper <djasper@google.com>

clang-format: Always align */& in multi-var DeclStmts.

Seems like the most consistent thing to do and in multi-var DeclStmts,
it is especially important to point out that the */& bind to the
identif

clang-format: Always align */& in multi-var DeclStmts.

Seems like the most consistent thing to do and in multi-var DeclStmts,
it is especially important to point out that the */& bind to the
identifier.

llvm-svn: 230903

show more ...


# 308062bd 27-Feb-2015 Daniel Jasper <djasper@google.com>

clang-format: Make trailing commas in array inits force one per line.

Before:
NSArray *array = @[ @"a", @"a", ];

After:
NSArray *array = @[
@"a",
@"a",
];

llvm-svn: 230741


# b812e323 26-Feb-2015 Daniel Jasper <djasper@google.com>

clang-format: Make braced list formatting more consistent.

Before:
Aaaa aaaaaaaaaaa{
{
a, // +1 indent weird.
b, // trailing comma signals one per line.
}, // trailing c

clang-format: Make braced list formatting more consistent.

Before:
Aaaa aaaaaaaaaaa{
{
a, // +1 indent weird.
b, // trailing comma signals one per line.
}, // trailing comma signals one per line.
};

After:
Aaaa aaaaaaaaaaa{
{
a, // better!?
b, // trailing comma signals one per line.
}, // trailing comma signals one per line.
};

Interesting that this apparently was entirely untested :-(.

llvm-svn: 230627

show more ...


# beaa322c 26-Feb-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix space of arrays of pointers to templated types.

Before:
vector<int>(*foo_)[6];

After:
vector<int> (*foo_)[6];

llvm-svn: 230625


# a42de763 26-Feb-2015 Daniel Jasper <djasper@google.com>

clang-format: Allow breaking after "else if(" as a last resort.

This isn't generally nice, but better than violating the column limit.

llvm-svn: 230620


# 1c220488 25-Feb-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix spacing for function with ref-qualification ..

.. when using SpacesInCStyleCastParentheses != SpacesInParentheses.

Before:
FormatStyle Spaces = getLLVMStyle();
Deleted &operat

clang-format: Fix spacing for function with ref-qualification ..

.. when using SpacesInCStyleCastParentheses != SpacesInParentheses.

Before:
FormatStyle Spaces = getLLVMStyle();
Deleted &operator=(const Deleted &)& = default;

Spaces.SpacesInParentheses = true;
Deleted(const Deleted &)& = default;

Spaces.SpacesInCStyleCastParentheses = true;
Spaces.SpacesInParentheses= false;
Deleted( const Deleted & )& = default;

After:
FormatStyle Spaces = getLLVMStyle();
Deleted &operator=(const Deleted &)& = default;;

Spaces.SpacesInParentheses= true;
Deleted( const Deleted & )& = default;

Spaces.SpacesInCStyleCastParentheses = true;
Spaces.SpacesInParentheses= false;
Deleted(const Deleted &)& = default;

Patch by Jean-Philippe Dufraigne. Thank you!

llvm-svn: 230473

show more ...


Revision tags: llvmorg-3.6.0
# 411b251c 24-Feb-2015 Jacques Pienaar <jpienaar@google.com>

clang-format: Change location of stashed token

Commit of patch in http://reviews.llvm.org/D7871

llvm-svn: 230395


# 68a7dbf8 20-Feb-2015 Jacques Pienaar <jpienaar@google.com>

Fix merging of << at end of input.

Commit of review http://reviews.llvm.org/D7766

llvm-svn: 230061


1...<<41424344454647484950>>...82