History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 1501 – 1525 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 5903685a 12-Aug-2013 Daniel Jasper <djasper@google.com>

clang-format: Correctly format alias declarations.

Before:
template <class CallbackClass>
using MyCallback = void(CallbackClass::*)(SomeObject * Data);");

After:
template <class CallbackClass

clang-format: Correctly format alias declarations.

Before:
template <class CallbackClass>
using MyCallback = void(CallbackClass::*)(SomeObject * Data);");

After:
template <class CallbackClass>
using MyCallback = void (CallbackClass::*)(SomeObject *Data);");

Also fix three wrong indentations.

llvm-svn: 188172

show more ...


# d5735503 12-Aug-2013 Manuel Klimek <klimek@google.com>

This change fixes the formatting of statements such as catch (E& e).

Previously these were formatting as catch (E & e) because the inner parenthesis
was being marked as an expression.

Patch by Thom

This change fixes the formatting of statements such as catch (E& e).

Previously these were formatting as catch (E & e) because the inner parenthesis
was being marked as an expression.

Patch by Thomas Gibson-Robinson.

llvm-svn: 188153

show more ...


# a8177a02 08-Aug-2013 Arnold Schwaighofer <aschwaighofer@apple.com>

Revert r187935 "Support for double width characters."

It broke a public build bot.

llvm-svn: 187957


# ca3e6311 07-Aug-2013 Alexander Kornienko <alexfh@google.com>

Support for double width characters.

Summary: Only works for UTF-8-encoded files.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chand

Support for double width characters.

Summary: Only works for UTF-8-encoded files.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D1311

llvm-svn: 187935

show more ...


# a027f306 07-Aug-2013 Manuel Klimek <klimek@google.com>

Fixes a couple of bugs with the Allman brace breaking.

In particular, left braces after an enum declaration now occur on their
own line. Further, when short ifs/whiles are allowed these no longer
c

Fixes a couple of bugs with the Allman brace breaking.

In particular, left braces after an enum declaration now occur on their
own line. Further, when short ifs/whiles are allowed these no longer
cause the left brace to be on the same line as the if/while when a
brace is included.

Patch by Thomas Gibson-Robinson.

llvm-svn: 187901

show more ...


# 9613c81f 07-Aug-2013 Daniel Jasper <djasper@google.com>

clang-format: Fix corner case in OpenMP pragma formatting.

Before:
#pragma omp reduction( | : var)
After:
#pragma omp reduction(| : var)

llvm-svn: 187892


# d6877f05 07-Aug-2013 Daniel Jasper <djasper@google.com>

clang-format: Improve formatting of builder-type calls.

This removes a formatting choice that was added at one point, but is
not generally liked by users. Specifically, in builder-type calls, do
(ea

clang-format: Improve formatting of builder-type calls.

This removes a formatting choice that was added at one point, but is
not generally liked by users. Specifically, in builder-type calls, do
(easily) break if the object before the ./-> is either a field or a
parameter-less function call. I.e., don't break after "aa.aa.aa" or
"aa.aa.aa()". In general, these sequences in builder-type calls are
seen as a single entity and thus breaking them up is a bad idea.

llvm-svn: 187865

show more ...


# d3ed59ae 02-Aug-2013 Manuel Klimek <klimek@google.com>

Implement Allman style.

Patch by Frank Miller.

llvm-svn: 187678


# 3dcd7eca 02-Aug-2013 Daniel Jasper <djasper@google.com>

clang-format: Fix string breaking after "<<".

Before, clang-format would not break overly long string literals
following a "<<" with FormatStyle::AlwaysBreakBeforeMultilineStrings
being set.

llvm-s

clang-format: Fix string breaking after "<<".

Before, clang-format would not break overly long string literals
following a "<<" with FormatStyle::AlwaysBreakBeforeMultilineStrings
being set.

llvm-svn: 187650

show more ...


# 7cdc78b3 01-Aug-2013 Daniel Jasper <djasper@google.com>

clang-format: Operator precendence in ObjC method exprs.

Patch (mostly) by Adam Strzelecki. Thanks!

Before:
[self aaaaaa:bbbbbbbbbbbbb
aaaaaaaaaa:bbbbbbbbbbbbbbbbb
aaaaa:bbbbbbbb

clang-format: Operator precendence in ObjC method exprs.

Patch (mostly) by Adam Strzelecki. Thanks!

Before:
[self aaaaaa:bbbbbbbbbbbbb
aaaaaaaaaa:bbbbbbbbbbbbbbbbb
aaaaa:bbbbbbbbbbb +
bbbbbbbbbbbb aaaa:bbb];

After:
[self aaaaaa:bbbbbbbbbbbbb
aaaaaaaaaa:bbbbbbbbbbbbbbbbb
aaaaa:bbbbbbbbbbb + bbbbbbbbbbbb
aaaa:bbb];

This fixes llvm.org/PR16150.

llvm-svn: 187631

show more ...


# b1ae734f 01-Aug-2013 Daniel Jasper <djasper@google.com>

clang-format: Don't break empty 2nd operand of ternary expr.

Before:
some_quite_long_variable_name_ptr
?
: argv[9] ? ptr : argv[8] ? : argv[7] ? ptr : argv[6];
After:
some_quite_long

clang-format: Don't break empty 2nd operand of ternary expr.

Before:
some_quite_long_variable_name_ptr
?
: argv[9] ? ptr : argv[8] ? : argv[7] ? ptr : argv[6];
After:
some_quite_long_variable_name_ptr
?: argv[9] ? ptr : argv[8] ?: argv[7] ? ptr : argv[6];

Patch by Adam Strzelecki, thank you!!

This fixed llvm.org/PR16758.

llvm-svn: 187622

show more ...


# 8b1c6354 01-Aug-2013 Daniel Jasper <djasper@google.com>

Teach clang-format to understand static_asserts better.

Before:
template <bool B, bool C>
class A {
static_assert(B &&C, "Something is wrong");
};

After:
template <bool B, bool C>
cla

Teach clang-format to understand static_asserts better.

Before:
template <bool B, bool C>
class A {
static_assert(B &&C, "Something is wrong");
};

After:
template <bool B, bool C>
class A {
static_assert(B && C, "Something is wrong");
};

(Note the spacing around '&&'). Also change the identifier table to always
understand all C++11 keywords (which seems like the right thing to do).

llvm-svn: 187589

show more ...


# 9688ff19 01-Aug-2013 Daniel Jasper <djasper@google.com>

clang-format: Improve line breaks in @property.

Before:
@property(nonatomic, assign,
readonly) NSString *looooooooooooooooooooooooooooongName;

After:
@property(nonatomic, assign, re

clang-format: Improve line breaks in @property.

Before:
@property(nonatomic, assign,
readonly) NSString *looooooooooooooooooooooooooooongName;

After:
@property(nonatomic, assign, readonly)
NSString *looooooooooooooooooooooooooooongName;

llvm-svn: 187577

show more ...


# 552f4a7e 31-Jul-2013 Daniel Jasper <djasper@google.com>

clang-format: Make alignment of trailing comments optional ..

.. in order to support WebKit style properly.

llvm-svn: 187549


# 65ee3472 31-Jul-2013 Daniel Jasper <djasper@google.com>

clang-format: Add more options to namespace indentation.

With this patch, clang-format can be configured to:
* not indent in namespace at all (former behavior).
* indent in namespace as in other blo

clang-format: Add more options to namespace indentation.

With this patch, clang-format can be configured to:
* not indent in namespace at all (former behavior).
* indent in namespace as in other blocks.
* indent only in inner namespaces (as required by WebKit style).

Also fix alignment of access specifiers in WebKit style.

Patch started by Marek Kurdej. Thank you!

llvm-svn: 187540

show more ...


# 62c0ac0a 30-Jul-2013 Daniel Jasper <djasper@google.com>

clang-format: Improve detection of templates.

Before:
template <typename... Types>
typename enable_if < 0<sizeof...(Types)>::type Foo() {}
After:
template <typename... Types>
typename

clang-format: Improve detection of templates.

Before:
template <typename... Types>
typename enable_if < 0<sizeof...(Types)>::type Foo() {}
After:
template <typename... Types>
typename enable_if<0 < sizeof...(Types)>::type Foo() {}

llvm-svn: 187458

show more ...


# e33d4afa 26-Jul-2013 Daniel Jasper <djasper@google.com>

clang-format: Add two new style options to support WebKit style.

New options:
* Break before the commas of constructor initializers and align
the commas with the colon.
* Break before binary opera

clang-format: Add two new style options to support WebKit style.

New options:
* Break before the commas of constructor initializers and align
the commas with the colon.
* Break before binary operators

Additionally, for styles without column limit, don't just accept
linebreaks done by the user, but instead remove 'invalid' (according
to the current style) linebreaks and add 'required' ones.

llvm-svn: 187210

show more ...


# 516d7971 25-Jul-2013 Daniel Jasper <djasper@google.com>

clang-format: Fix switch/case interaction with macros.

Before:
#define OPERATION_CASE(name) \
case OP_name: \
return operations::Operation##name

switch (OpCode) {
CAS

clang-format: Fix switch/case interaction with macros.

Before:
#define OPERATION_CASE(name) \
case OP_name: \
return operations::Operation##name

switch (OpCode) {
CASE(Add);
CASE(Subtract);
default:
return operations::Unknown;
}

After:
#define OPERATION_CASE(name) \
case OP_name: \
return operations::Operation##name;

switch (OpCode) {
CASE(Add);
CASE(Subtract);
default:
return operations::Unknown;
}

llvm-svn: 187118

show more ...


# ffefb3d1 24-Jul-2013 Daniel Jasper <djasper@google.com>

clang-format: Initial (incomplete) support for the WebKit coding style.

This is far from implementing all the rules given by
http://www.webkit.org/coding/coding-style.html

The important new feature

clang-format: Initial (incomplete) support for the WebKit coding style.

This is far from implementing all the rules given by
http://www.webkit.org/coding/coding-style.html

The important new feature is the support for styles that don't have a
column limit. For such styles, clang-format will (at the moment) simply
respect the input's formatting decisions within statements.

llvm-svn: 187033

show more ...


# 998cabcf 18-Jul-2013 Daniel Jasper <djasper@google.com>

clang-format: Fix bad line break with pointers to members.

Before:
void f() {
(a->*
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(aaaa,
bbbbbbbbbbbbbbbb

clang-format: Fix bad line break with pointers to members.

Before:
void f() {
(a->*
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(aaaa,
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
}

After:
void f() {
(a->*aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)(
aaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);
}

Also add missing test case.

llvm-svn: 186583

show more ...


# ee6d650f 17-Jul-2013 Daniel Jasper <djasper@google.com>

clang-format: Add space in corner case.

Before:
SomeType s __attribute__((unused))(InitValue);
After:
SomeType s __attribute__((unused)) (InitValue);

llvm-svn: 186535


# c834c709 17-Jul-2013 Daniel Jasper <djasper@google.com>

Improve line breaking before multi-line strings.

The AlwaysBreakBeforeMultilineStrings rule does not really make sense
if it does not a column gain.

Before (in Google style):
f(
"aaaa"

Improve line breaking before multi-line strings.

The AlwaysBreakBeforeMultilineStrings rule does not really make sense
if it does not a column gain.

Before (in Google style):
f(
"aaaa"
"bbbb");

After:
f("aaaa"
"bbbb");

llvm-svn: 186515

show more ...


# 94042342 16-Jul-2013 Alexander Kornienko <alexfh@google.com>

Avoid breaking non-trailing block comments.

Motivating example:
// column limit ------------------->
void ffffffffffff(int aaaaaa /* test */);

Formatting before the patch:
void ffffffffffff(int aaa

Avoid breaking non-trailing block comments.

Motivating example:
// column limit ------------------->
void ffffffffffff(int aaaaaa /* test */);

Formatting before the patch:
void ffffffffffff(int aaaaaa /* test
*/);

Formatting after the patch:
void
ffffffffffff(int aaaaaa /* test */);

llvm-svn: 186471

show more ...


# 657c67b1 16-Jul-2013 Alexander Kornienko <alexfh@google.com>

Don't break line comments with escaped newlines.

Summary:
These can appear when comments contain command lines with quoted line
breaks. As the text (including escaped newlines and '//' from consecut

Don't break line comments with escaped newlines.

Summary:
These can appear when comments contain command lines with quoted line
breaks. As the text (including escaped newlines and '//' from consecutive lines)
is a single line comment, we used to break it even when it didn't exceed column
limit. This is a temporary solution, in the future we may want to support this
case completely - at least adjust leading whitespace when changing indentation
of the first line.

Reviewers: djasper

Reviewed By: djasper

CC: cfe-commits, klimek

Differential Revision: http://llvm-reviews.chandlerc.com/D1146

llvm-svn: 186456

show more ...


# 8369aa5e 16-Jul-2013 Daniel Jasper <djasper@google.com>

clang-format: Improve handling of unterminated string literals.

Before, clang-format would simply eat these as they were recognized as
whitespace. With this patch, they are mostly left alone.

llvm-

clang-format: Improve handling of unterminated string literals.

Before, clang-format would simply eat these as they were recognized as
whitespace. With this patch, they are mostly left alone.

llvm-svn: 186454

show more ...


1...<<61626364656667686970>>...82