History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 1101 – 1125 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 6a3fd836 17-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix regression introduced in r221609.

Before:
void f() { f(a, c *d); }

After:
void f() { f(a, c * d); }

llvm-svn: 222128


# d127e3b6 14-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Correctly detect multiplication in ctor initializer.

Before:
Constructor() : a(a), area(width *height) {}

After:
Constructor() : a(a), area(width * height) {}

llvm-svn: 222010


# 6c0ee17b 14-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Improve function parameter packing.

Before:
void SomeLoooooooooooongFunction(
std::unique_ptr<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
aaaaaaaaaaaaaaaaaaaaaaaaaa, int bbbbbb

clang-format: Improve function parameter packing.

Before:
void SomeLoooooooooooongFunction(
std::unique_ptr<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
aaaaaaaaaaaaaaaaaaaaaaaaaa, int bbbbbbbbbbbbb);

After:
void SomeLoooooooooooongFunction(
std::unique_ptr<aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa>
aaaaaaaaaaaaaaaaaaaaaaaaaa,
int bbbbbbbbbbbbb);

llvm-svn: 221989

show more ...


# 6c22c44e 14-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Support assignments as conditional operands.

Before:
return a != b
// comment
? a
: a = a != b
// comment
? a =

clang-format: Support assignments as conditional operands.

Before:
return a != b
// comment
? a
: a = a != b
// comment
? a =
b : a;
After:
return a != b
// comment
? a
: a = a != b
// comment
? a = b
: a;

llvm-svn: 221987

show more ...


# 119ff533 14-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Improve indentation of comments in expressions.

Before:
int i = (a)
// comment
+ b;
return aaaa == bbbb
// comment
? aaaa

clang-format: Improve indentation of comments in expressions.

Before:
int i = (a)
// comment
+ b;
return aaaa == bbbb
// comment
? aaaa
: bbbb;
After:
int i = (a)
// comment
+ b;
return aaaa == bbbb
// comment
? aaaa
: bbbb;

llvm-svn: 221985

show more ...


# 34272657 13-Nov-2014 Nico Weber <nicolasweber@gmx.de>

clang-format: Format extern "C" blocks like namespace blocks.

namespace blocks act as if KeepEmptyLinesAtTheStartOfBlocks is always true,
and aren't collapsed to a single line even if they would fit

clang-format: Format extern "C" blocks like namespace blocks.

namespace blocks act as if KeepEmptyLinesAtTheStartOfBlocks is always true,
and aren't collapsed to a single line even if they would fit. Do the same
for extern "C" blocks.

Before,

extern "C" {

void ExternCFunction();

}

was collapsed into `extern "C" { void ExternCFunction(); }`. Now it stays like
it was.

Fixes http://crbug.com/432640 and part of PR21419.

llvm-svn: 221897

show more ...


# 3eb341c4 11-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Improve handling of comments in binary expressions.

Before:
b = a &&
// Comment
b.c &&
d;

After:
b = a &&
// Comment
b.c && d;

This fixes llvm.org/P

clang-format: Improve handling of comments in binary expressions.

Before:
b = a &&
// Comment
b.c &&
d;

After:
b = a &&
// Comment
b.c && d;

This fixes llvm.org/PR21535.

llvm-svn: 221727

show more ...


# 64a328e9 11-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Preserve trailing-comma logic even with comments.

Before:
vector<int> SomeVector = {// aaa
1, 2,
};

After:
vector<int> SomeVector = {
// aaa

clang-format: Preserve trailing-comma logic even with comments.

Before:
vector<int> SomeVector = {// aaa
1, 2,
};

After:
vector<int> SomeVector = {
// aaa
1, 2,
};

llvm-svn: 221699

show more ...


# 0bd9a19b 10-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix pointer formatting.

Before:
void f(Bar* a = nullptr, Bar * b);
After:
void f(Bar* a = nullptr, Bar* b);

llvm-svn: 221609


# e551bb70 05-Nov-2014 Daniel Jasper <djasper@google.com>

Revert "clang-format: [js] Updates to Google's JavaScript style."

This reverts commit eefd2eaad43c5c2b17953ae7ed1e72b28e696f7b.

Apparently, this change was a bit premature.

llvm-svn: 221365


# 502fac38 05-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Add test to prevent regression in r221125.

llvm-svn: 221339


# 680b09ba 05-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Improve free-standing macro detection.

Before:
SOME_WEIRD_LOG_MACRO
<< "Something long enough to cause a line break";

After:
SOME_WEIRD_LOG_MACRO
<< "Something long enough

clang-format: Improve free-standing macro detection.

Before:
SOME_WEIRD_LOG_MACRO
<< "Something long enough to cause a line break";

After:
SOME_WEIRD_LOG_MACRO
<< "Something long enough to cause a line break";

llvm-svn: 221338

show more ...


# 8022226d 02-Nov-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix false positive in lambda detection.

Before:
delete [] a -> b;

After:
delete[] a->b;

This fixes part of llvm.org/PR21419.

llvm-svn: 221114


# f739b0db 31-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: [js] Updates to Google's JavaScript style.

The style guide is changing..

llvm-svn: 220977


# ac29eacc 29-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: Format line if invoked on the trailing newline.

llvm-svn: 220883


# f0c809a1 28-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: Improve && detection as binary operator.

Before:
template <class T,
class = typename ::std::enable_if<
::std::is_array<T>{}&& ::std::is_array<T>{}>::type>

clang-format: Improve && detection as binary operator.

Before:
template <class T,
class = typename ::std::enable_if<
::std::is_array<T>{}&& ::std::is_array<T>{}>::type>
void F();

After:
template <class T,
class = typename ::std::enable_if<
::std::is_array<T>{} && ::std::is_array<T>{}>::type>
void F();

llvm-svn: 220813

show more ...


# acb7e25d 28-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix test.

llvm-svn: 220807


# 13a7f469 28-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: Improve && detection as binary operators.

Before:
template <class T, class = typename std::enable_if<std::is_integral<
T>::value &&(sizeof(T) > 1 || sizeof(T

clang-format: Improve && detection as binary operators.

Before:
template <class T, class = typename std::enable_if<std::is_integral<
T>::value &&(sizeof(T) > 1 || sizeof(T) < 8)>::type>
void F();

After:
template <class T, class = typename std::enable_if<
std::is_integral<T>::value &&
(sizeof(T) > 1 || sizeof(T) < 8)>::type>
void F();

llvm-svn: 220805

show more ...


# 2ad0aba6 28-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: Improve function declaration detection.

Before:
ReturnType MACRO
FunctionName() {}

After:
ReturnType MACRO
FunctionName() {}

This fixes llvm.org/PR21404.

I wonder what t

clang-format: Improve function declaration detection.

Before:
ReturnType MACRO
FunctionName() {}

After:
ReturnType MACRO
FunctionName() {}

This fixes llvm.org/PR21404.

I wonder what the motivation for that if-condition was. But as no test
breaks, ...

llvm-svn: 220801

show more ...


# 50d634b3 28-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: [ObjC] Add separate flag to control indentation in blocks

Apparently, people are very much divided on what the "correct"
indentation is. So, best to give them a choice.

The new flag i

clang-format: [ObjC] Add separate flag to control indentation in blocks

Apparently, people are very much divided on what the "correct"
indentation is. So, best to give them a choice.

The new flag is called ObjCBlockIndentWidth and the default is now set
to the same value as IndentWidth for the pre-defined styles.

llvm-svn: 220784

show more ...


# e068ac77 27-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: Don't break after very short return types.

Before:
void
SomeFunction(int parameter);

After:
void SomeFunction(
int parameter);

(Unless AlwaysBreakAfterDefinitionReturnTyp

clang-format: Don't break after very short return types.

Before:
void
SomeFunction(int parameter);

After:
void SomeFunction(
int parameter);

(Unless AlwaysBreakAfterDefinitionReturnType after type is set).

llvm-svn: 220686

show more ...


# 56346193 27-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix bad merging of lines in nested blocks.

Before:
SomeFunction([]() {
#define A a
return 43; });

After:
SomeFunction([]() {
#define A a
return 43;
});

llvm-svn: 22

clang-format: Fix bad merging of lines in nested blocks.

Before:
SomeFunction([]() {
#define A a
return 43; });

After:
SomeFunction([]() {
#define A a
return 43;
});

llvm-svn: 220684

show more ...


# f322eb5c 23-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix incorrect space after "<".

Before:
bool a = 2 <::SomeFunction();

After:
bool a = 2 < ::SomeFunction();

llvm-svn: 220505


# 76284683 22-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: Use AllowShortBlocksOnASingleLine for ObjC blocks, too.

llvm-svn: 220375


# b52c69e5 22-Oct-2014 Daniel Jasper <djasper@google.com>

clang-format: Fix broken test.

llvm-svn: 220374


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