History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 901 – 925 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-3.7.1-rc1
# da446770 16-Nov-2015 Daniel Jasper <djasper@google.com>

clang-format: Enable #include sorting by default.

This has seen quite some usage and I am not aware of any issues. Also
add a style option to enable/disable include sorting. The existing
command lin

clang-format: Enable #include sorting by default.

This has seen quite some usage and I am not aware of any issues. Also
add a style option to enable/disable include sorting. The existing
command line flag can from now on be used to override whatever is set
in the style.

llvm-svn: 253202

show more ...


# 328085f3 30-Oct-2015 Saleem Abdulrasool <compnerd@compnerd.org>

Format: support inline namespaces

Correct handling for C++17 inline namespaces. We would previously fail to
identify the inline namespaces as a namespace name since multiple ones may be
concatenate

Format: support inline namespaces

Correct handling for C++17 inline namespaces. We would previously fail to
identify the inline namespaces as a namespace name since multiple ones may be
concatenated now with C++17.

llvm-svn: 251690

show more ...


# bd73bcf8 27-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: Undo unwanted format change done in r251405.

Specifically, don't wrap between the {} of an empty constructor if the
"}" falls on column 81 and ConstructorInitializerAllOnOneLineOrOnePe

clang-format: Undo unwanted format change done in r251405.

Specifically, don't wrap between the {} of an empty constructor if the
"}" falls on column 81 and ConstructorInitializerAllOnOneLineOrOnePerLine
is set.

llvm-svn: 251406

show more ...


# 6501f7e8 27-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: Add an additional value to AlignAfterOpenBracket: AlwaysBreak.

Summary:
If this option is set, clang-format will always insert a line wrap, e.g.
before the first parameter of a functio

clang-format: Add an additional value to AlignAfterOpenBracket: AlwaysBreak.

Summary:
If this option is set, clang-format will always insert a line wrap, e.g.
before the first parameter of a function call unless all parameters fit
on the same line. This obviates the need to make a decision on the
alignment itself.

Use this style for Google's JavaScript style and add some minor tweaks
to correctly handle nested blocks etc. with it. Don't use this option
for for/while loops.

Reviewers: klimek

Subscribers: klimek, cfe-commits

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

llvm-svn: 251405

show more ...


# 74331d4c 26-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix false positive in cast detection.

Before (with spaces in parentheses):
void inFunction() { std::function<void( int, int )> fct; }

After:
void inFunction() { std::function<void

clang-format: Fix false positive in cast detection.

Before (with spaces in parentheses):
void inFunction() { std::function<void( int, int )> fct; }

After:
void inFunction() { std::function<void( int, int)> fct; }

llvm-svn: 251284

show more ...


# 4d72449d 12-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: Fixed typecast getting put on a separate line from the
key in Obj-C dictionary literals

This fixes: https://llvm.org/PR22647

Patch by Kent Sutherland. Thank you.

llvm-svn: 250010


# 9cb1ac28 07-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: Fixed missing space between Obj-C for/in and a typecast.

Fixes this bug: https://llvm.org/bugs/show_bug.cgi?id=24504

TokenAnnotator::spaceRequiredBetween was handling TT_ForEachMacro

clang-format: Fixed missing space between Obj-C for/in and a typecast.

Fixes this bug: https://llvm.org/bugs/show_bug.cgi?id=24504

TokenAnnotator::spaceRequiredBetween was handling TT_ForEachMacro but
not TT_ObjCForIn, so lines that look like:

for (id nextObject in (NSArray *)myArray)

would incorrectly turn into:

for (id nextObject in(NSArray *)myArray)

Patch by Kent Sutherland, thank you.

llvm-svn: 249553

show more ...


# 39828256 07-Oct-2015 Daniel Jasper <djasper@google.com>

[clang-format] Stop alignment sequences on open braces and parens when
aligning assignments.

This was done correctly when aligning the declarations, but not when
aligning assignments.

FIXME: The co

[clang-format] Stop alignment sequences on open braces and parens when
aligning assignments.

This was done correctly when aligning the declarations, but not when
aligning assignments.

FIXME: The code between assignments and declarations alignment is
roughly duplicated and
would benefit from factorization.

Bug 25090: https://llvm.org/bugs/show_bug.cgi?id=25090

Patch by Beren Minor. Thank you.

llvm-svn: 249552

show more ...


# 55bbe664 07-Oct-2015 Daniel Jasper <djasper@google.com>

Make clang-format actually respect custom brace wrapping flags.

This fixes llvm.org/PR25073.

llvm-svn: 249519


# 5af04a4d 07-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix false ObjC block detection.

Before:
inline A operator^(const A &lhs, const A &rhs) {} int i;

After:
inline A operator^(const A &lhs, const A &rhs) {}
int i;

llvm-svn: 249517


# 4bc013e1 07-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: Understand array reference types.

Before:
void f(Type(&parameter)[10]) {}
void f(Type (*parameter)[10]) {}

After:
void f(Type (&parameter)[10]) {}
void f(Type (*parameter)[10]

clang-format: Understand array reference types.

Before:
void f(Type(&parameter)[10]) {}
void f(Type (*parameter)[10]) {}

After:
void f(Type (&parameter)[10]) {}
void f(Type (*parameter)[10]) {}

llvm-svn: 249502

show more ...


# 0ea4d799 07-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix false positive in pointer/reference detection.

Before:
return options != nullptr &&operator==(*options);

After:
return options != nullptr && operator==(*options);

llvm-svn: 2

clang-format: Fix false positive in pointer/reference detection.

Before:
return options != nullptr &&operator==(*options);

After:
return options != nullptr && operator==(*options);

llvm-svn: 249501

show more ...


# 8ce1b8df 06-Oct-2015 Daniel Jasper <djasper@google.com>

clang-format: Make IncludeCategories configurable in .clang-format file.

This was made much easier by introducing an IncludeCategory struct to
replace the previously used std::pair.

Also, cleaned u

clang-format: Make IncludeCategories configurable in .clang-format file.

This was made much easier by introducing an IncludeCategory struct to
replace the previously used std::pair.

Also, cleaned up documentation and added examples.

llvm-svn: 249392

show more ...


# e12597cc 01-Oct-2015 Daniel Jasper <djasper@google.com>

[clang-format] Add support of consecutive declarations alignment

This allows clang-format to align identifiers in consecutive
declarations. This is useful for increasing the readability of the code

[clang-format] Add support of consecutive declarations alignment

This allows clang-format to align identifiers in consecutive
declarations. This is useful for increasing the readability of the code
in the same way the alignment of assignations is.

The code is a slightly modified version of the consecutive assignment
alignment code. Currently only the identifiers are aligned, and there is
no support of alignment of the pointer star or reference symbol.

The patch also solve the issue of alignments not being possible due to
the ColumnLimit for both the existing AlignConsecutiveAligments and the
new AlignConsecutiveDeclarations.

Patch by Beren Minor, thank you.

Review: http://reviews.llvm.org/D12362
llvm-svn: 248999

show more ...


# c1bc38ed 29-Sep-2015 Daniel Jasper <djasper@google.com>

clang-format: Add a new brace style "custom" as well as flags to
control the individual braces. The existing choices for brace wrapping
are now merely presets for the different flags that get expande

clang-format: Add a new brace style "custom" as well as flags to
control the individual braces. The existing choices for brace wrapping
are now merely presets for the different flags that get expanded upon
calling the reformat function.

All presets have been chose to keep the existing formatting, so there
shouldn't be any difference in formatting behavior.

Also change the dump_format_style.py to properly document the nested
structs that are used to keep these flags discoverable among all the
configuration flags.

llvm-svn: 248802

show more ...


# bbfd20d7 22-Sep-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix alignConsecutiveAssignments.

It wasn't correctly handling this case:

int oneTwoThree = 123;
int oneTwo = 12;
method();

Review: http://reviews.llvm.org/D12369
Patch by

clang-format: Fix alignConsecutiveAssignments.

It wasn't correctly handling this case:

int oneTwoThree = 123;
int oneTwo = 12;
method();

Review: http://reviews.llvm.org/D12369
Patch by Beren Minor. Thank you!

llvm-svn: 248254

show more ...


# 368369b4 21-Sep-2015 Daniel Jasper <djasper@google.com>

clang-format: Fix merging short case labels with comments.

This fixes llvm.org/PR24877.

Patch by Benjamin Daly, thank you!

llvm-svn: 248145


Revision tags: llvmorg-3.7.0
# 7b259cda 27-Aug-2015 Daniel Jasper <djasper@google.com>

clang-format: Don't let a leading "template <..>" lead to wrapped initializers.

Before:
Constructor() : initializer(0) {}

template <typename T>
Constructor()
: initializer(0) {}

After:

clang-format: Don't let a leading "template <..>" lead to wrapped initializers.

Before:
Constructor() : initializer(0) {}

template <typename T>
Constructor()
: initializer(0) {}

After:
Constructor() : initializer(0) {}

template <typename T>
Constructor() : initializer(0) {}

llvm-svn: 246146

show more ...


Revision tags: llvmorg-3.7.0-rc4
# af642c69 25-Aug-2015 Daniel Jasper <djasper@google.com>

clang-format: Add space before member function reference qualifiers.

Before:
SomeType MemberFunction(const Deleted &)&;

After:
SomeType MemberFunction(const Deleted &) &;

Seems to be much more

clang-format: Add space before member function reference qualifiers.

Before:
SomeType MemberFunction(const Deleted &)&;

After:
SomeType MemberFunction(const Deleted &) &;

Seems to be much more common.

llvm-svn: 245934

show more ...


# 788ffd71 24-Aug-2015 Daniel Jasper <djasper@google.com>

clang-format: Always allow break after leading annotations.

Before:
DEPRECATED("Use NewClass::NewFunction instead.") int OldFunction(
const string &parameter) {}

Could not be formatted at all,

clang-format: Always allow break after leading annotations.

Before:
DEPRECATED("Use NewClass::NewFunction instead.") int OldFunction(
const string &parameter) {}

Could not be formatted at all, as clang-format would both require and
disallow the break before "int".

llvm-svn: 245846

show more ...


# 5d7f06fa 24-Aug-2015 Daniel Jasper <djasper@google.com>

clang-format: Make formatting of member function reference qualifiers
more consistent.

Before:
SomeType MemberFunction(const Deleted &)&&;
SomeType MemberFunction(const Deleted &) && { ... }

Af

clang-format: Make formatting of member function reference qualifiers
more consistent.

Before:
SomeType MemberFunction(const Deleted &)&&;
SomeType MemberFunction(const Deleted &) && { ... }

After:
SomeType MemberFunction(const Deleted &)&&;
SomeType MemberFunction(const Deleted &)&& { ... }

llvm-svn: 245843

show more ...


# b86e2727 24-Aug-2015 Daniel Jasper <djasper@google.com>

clang-format: Properly handle braced lists in macros.

Before:
#define A \
{ a, a } \
,

After:
#define A {a, a},

llvm-svn: 245837


# 100ffc63 21-Aug-2015 Daniel Jasper <djasper@google.com>

clang-format: Be more conservative about specially indenting blocks in C++.

This is a bit of a step back of what we did in r222531, as there are
some corner cases in C++, where this kind of formatti

clang-format: Be more conservative about specially indenting blocks in C++.

This is a bit of a step back of what we did in r222531, as there are
some corner cases in C++, where this kind of formatting is really bad.

Example:
Before:
virtual aaaaaaaaaaaaaaaa(std::function<bool()> IsKindWeWant = [&]() {
return true;
}, aaaaa aaaaaaaaa);

After:
virtual aaaaaaaaaaaaaaaa(std::function<bool()> IsKindWeWant =
[&]() { return true; },
aaaaa aaaaaaaaa);

The block formatting logic in JavaScript will probably go some other changes,
too, and we'll potentially be able to make the rules more consistent again. For
now, this seems to be the best approach for C++.

llvm-svn: 245694

show more ...


Revision tags: llvmorg-3.7.0-rc3
# d788457d 14-Aug-2015 Daniel Jasper <djasper@google.com>

clang-format: Don't remove space between #elif and parentheses.

Before:
#elif(AAAA && BBBB)

After:
#elif (AAAA && BBBB)

llvm-svn: 245043


Revision tags: studio-1.4
# 033181bc 13-Aug-2015 Daniel Jasper <djasper@google.com>

clang-format: Inside decltype(), there is an expression.

Before:
decltype(a* b) F();

After:
decltype(a * b) F();

llvm-svn: 244891


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