History log of /llvm-project/clang/unittests/Format/FormatTest.cpp (Results 126 – 150 of 2034)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1f012690 03-Oct-2023 Björn Schäpers <bjoern@hazardy.de>

[clang-format] Fix alignment in presence of template functions (#68029)

Fixes #68102.


Revision tags: llvmorg-17.0.2
# 75441a68 02-Oct-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a bug in RemoveParentheses: ReturnStatement (#67911)

Don't remove the outermost parentheses surrounding a return statement
expression when inside a function/lambda that has the d

[clang-format] Fix a bug in RemoveParentheses: ReturnStatement (#67911)

Don't remove the outermost parentheses surrounding a return statement
expression when inside a function/lambda that has the decltype(auto)
return type.

Fixed #67892.

show more ...


# 0468fa07 29-Sep-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Don't align ctors and dtors with other functions (#67618)

Fixed #67604.


# 82001e0d 28-Sep-2023 Jon Phillips <jphillips@cloudflare.com>

[clang-format] Disable OuterScope lambda indentation behaviour for constructor initializers (#66755)

By default, OuterScope aligns lambdas to the beginning of the current
line. This makes sense for

[clang-format] Disable OuterScope lambda indentation behaviour for constructor initializers (#66755)

By default, OuterScope aligns lambdas to the beginning of the current
line. This makes sense for most types of statements within code blocks
but leads to unappealing and misleading indentation for lambdas within
constructor initializers.

show more ...


Revision tags: llvmorg-17.0.1, llvmorg-17.0.0
# 5ed94c6e 15-Sep-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Fix a bug in ContinuationIndenter (#66354)

See https://reviews.llvm.org/D136154#3890747 for context.

Fixes part of #58592.


# b908123c 11-Sep-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Minor cleanup of token annotator and test cases


# 84e3fdfc 09-Sep-2023 Björn Schäpers <bjoern@hazardy.de>

[clang-format] BreakBeforeNoexceptSpecifier option added (#65808)

It really bugs me that it breaks to
``` c++
...) noexcept(
noexcept(condition)...
```

This is a fix for people like me.


# 210e7b3c 08-Sep-2023 Jon Phillips <jonap2811@gmail.com>

[clang-format] Improve line-breaking in LambdaBodyIndentation: OuterScope

Avoid unnecessarily aggressive line-breaking when using
"LambdaBodyIndentation: OuterScope" with argument bin-packing.

Diff

[clang-format] Improve line-breaking in LambdaBodyIndentation: OuterScope

Avoid unnecessarily aggressive line-breaking when using
"LambdaBodyIndentation: OuterScope" with argument bin-packing.

Differential Revision: https://reviews.llvm.org/D148131

show more ...


# f465a482 05-Sep-2023 Arkadiy Yudintsev <udincev@yandex.ru>

[clang-format] Fix segmentation fault when formatting nested namespaces

Fixing the clang-format crash with the segmentation fault error when
formatting code with nested namespaces.

Fixes #64701.

D

[clang-format] Fix segmentation fault when formatting nested namespaces

Fixing the clang-format crash with the segmentation fault error when
formatting code with nested namespaces.

Fixes #64701.

Differential Revision: https://reviews.llvm.org/D158363

show more ...


Revision tags: llvmorg-17.0.0-rc4
# 58c67e72 31-Aug-2023 Galen Elias <galenelias@gmail.com>

[clang-format] Fix AlignArrayOfStructures + Cpp11BracedListStyle=false

Currently AlignArrayOfStructures=Left is hard coding setting Spaces to
0 for the token following the initial opening brace, but

[clang-format] Fix AlignArrayOfStructures + Cpp11BracedListStyle=false

Currently AlignArrayOfStructures=Left is hard coding setting Spaces to
0 for the token following the initial opening brace, but not touching
Spaces for the subsequent lines, which leads to the array being
misaligned. Additionally, it's not adding a space before the trailing
} which is generally done when Cpp11BracedListStyle=false.

I'm not exactly sure why this function needs to override the Spaces as
it seems to generally already be set to either 0 or 1 according to
the other formatting settings, but I'm going with an explicit fix where
I just force the padding to 1 when Cpp11BracedListStyle=false.

AlignArrayOfStructures=Right doesn't have any alignment problems, but
isn't adding the expected padding around the braces either, so I'm
giving that the same treatment.

Fixes #57611.

Differential Revision: https://reviews.llvm.org/D158795

show more ...


# 14feca5d 30-Aug-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Replace EXPECT_EQ() with verifyFormat()

Replaces the remaining ones not covered in 8b131d2e1480.


# 8b131d2e 29-Aug-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Change EXPECT_EQ to verifyFormat or verifyNoChange

Replaces some 600 EXPECT_EQ() to verifyFormat() or verifyNoChange() in
FormatTest.cpp because the former neither checks stabili

[clang-format][NFC] Change EXPECT_EQ to verifyFormat or verifyNoChange

Replaces some 600 EXPECT_EQ() to verifyFormat() or verifyNoChange() in
FormatTest.cpp because the former neither checks stability of formatting
nor tests formatting C++ as Objective C.

Also marks dozens of unstable test cases with FIXME comments.

Differential Revision: https://reviews.llvm.org/D159051

show more ...


# 08630512 28-Aug-2023 Owen Pan <owenpiano@gmail.com>

Reland "[clang-format] Annotate constructor/destructor names"

(0e63f1aacc00 was reverted by 7590b7657004 due to a crash.)

Annotate constructor/destructor names as FunctionDeclarationName.

Fixes #6

Reland "[clang-format] Annotate constructor/destructor names"

(0e63f1aacc00 was reverted by 7590b7657004 due to a crash.)

Annotate constructor/destructor names as FunctionDeclarationName.

Fixes #63046.

Differential Revision: https://reviews.llvm.org/D157963

show more ...


# ca0aa533 26-Aug-2023 Björn Schäpers <bjoern@hazardy.de>

[clang-format] Handle Template Arguments with AlignConsecutiveXX

This fixes https://github.com/llvm/llvm-project/issues/64928.

Differential-Revision: https://reviews.llvm.org/D158945


# 7590b765 28-Aug-2023 Kadir Cetinkaya <kadircet@google.com>

Revert "[clang-format] Annotate constructor/destructor names"

This reverts commit 0e63f1aacc0040e9a16fa2fab15a140b1686e2ab.

clang-format started to crash with contents like:
a.h:
```
```
$ clang-fo

Revert "[clang-format] Annotate constructor/destructor names"

This reverts commit 0e63f1aacc0040e9a16fa2fab15a140b1686e2ab.

clang-format started to crash with contents like:
a.h:
```
```
$ clang-format a.h
```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0. Program arguments: ../llvm/build/bin/clang-format a.h
#0 0x0000560b689fe177 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /usr/local/google/home/kadircet/repos/llvm/llvm/lib/Support/Unix/Signals.inc:723:13
#1 0x0000560b689fbfbe llvm::sys::RunSignalHandlers() /usr/local/google/home/kadircet/repos/llvm/llvm/lib/Support/Signals.cpp:106:18
#2 0x0000560b689feaca SignalHandler(int) /usr/local/google/home/kadircet/repos/llvm/llvm/lib/Support/Unix/Signals.inc:413:1
#3 0x00007f030405a540 (/lib/x86_64-linux-gnu/libc.so.6+0x3c540)
#4 0x0000560b68a9a980 is /usr/local/google/home/kadircet/repos/llvm/clang/include/clang/Lex/Token.h:98:44
#5 0x0000560b68a9a980 is /usr/local/google/home/kadircet/repos/llvm/clang/lib/Format/FormatToken.h:562:51
#6 0x0000560b68a9a980 startsSequenceInternal<clang::tok::TokenKind, clang::tok::TokenKind> /usr/local/google/home/kadircet/repos/llvm/clang/lib/Format/FormatToken.h:831:9
#7 0x0000560b68a9a980 startsSequence<clang::tok::TokenKind, clang::tok::TokenKind> /usr/local/google/home/kadircet/repos/llvm/clang/lib/Format/FormatToken.h:600:12
#8 0x0000560b68a9a980 getFunctionName /usr/local/google/home/kadircet/repos/llvm/clang/lib/Format/TokenAnnotator.cpp:3131:17
#9 0x0000560b68a9a980 clang::format::TokenAnnotator::annotate(clang::format::AnnotatedLine&) /usr/local/google/home/kadircet/repos/llvm/clang/lib/Format/TokenAnnotator.cpp:3191:17
Segmentation fault
```

show more ...


# 19e3dfad 27-Aug-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Chang some verifyFormat() to verifyNoChange()


# f8838f85 25-Aug-2023 Owen Pan <owenpiano@gmail.com>

[clang-format][NFC] Remove extraneous newlines at end of test cases

Removes some 500 newlines (\n and \r\n) at the end of test cases in
FormatTest.cpp.

Also changes a few verifyFormat() to verifyNo

[clang-format][NFC] Remove extraneous newlines at end of test cases

Removes some 500 newlines (\n and \r\n) at the end of test cases in
FormatTest.cpp.

Also changes a few verifyFormat() to verifyNoChange() in tests
InsertNewlineAtEOF and WhitespaceSensitiveMacros as messUp() removes
trailing newlines as well.

Differential Revision: https://reviews.llvm.org/D158805

show more ...


Revision tags: llvmorg-17.0.0-rc3
# 0e63f1aa 17-Aug-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Annotate constructor/destructor names

Annotate constructor/destructor names as FunctionDeclarationName.

Fixes #63046.

Differential Revision: https://reviews.llvm.org/D157963


# 6e77ba6c 22-Aug-2023 Björn Schäpers <bjoern@hazardy.de>

[clang-format] Fix weird handling of AfterColon

Fixes #64895.

Differential Revision: https://reviews.llvm.org/D158505


# d06b9239 23-Aug-2023 Jon Phillips <jonap2811@gmail.com>

[clang-format] Fix a bug that wraps before function arguments

Fixes a long-standing bug that erroneously placed function arguments on a
new line despite all arguments being able to fit on the same l

[clang-format] Fix a bug that wraps before function arguments

Fixes a long-standing bug that erroneously placed function arguments on a
new line despite all arguments being able to fit on the same line.

The original diff that introduced the bug implemented behaviour that pushed
the first argument to a function onto a new line under certain circumstances
relating passing lambdas as arguments.

This behaviour was implemented in TokenAnnotator::mustBreakBefore() which
meant the code lacked the necessary context to figure out whether subsequent
arguments might be able to all fit on one line. As such, I've moved the
implementation to ContinuationIndenter and, instead of forcing a line break
at the first argument in all cases, we now allow the OptimizingLineFormatter
to consider placing the first argument on the same line as the function call
but don't allow further line breaks in this case.

The end result is that either the first argument must go on a new line (as
before) or all arguments must be put on the current line.

Closes #44486.

Differential Revision: https://reviews.llvm.org/D156259

show more ...


# e3a79503 17-Aug-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Exclude kw_decltype in RemoveParentheses

From https://en.cppreference.com/w/cpp/language/decltype:
Note that if the name of an object is parenthesized, it is treated as an
ordinary lv

[clang-format] Exclude kw_decltype in RemoveParentheses

From https://en.cppreference.com/w/cpp/language/decltype:
Note that if the name of an object is parenthesized, it is treated as an
ordinary lvalue expression, thus decltype(x) and decltype((x)) are often
different types.

Fixes #64786.

Differential Revision: https://reviews.llvm.org/D158155

show more ...


Revision tags: llvmorg-17.0.0-rc2
# a0b1c235 05-Aug-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Currectly handle PCIS_CurrentLine with no column limit

Fixes #63519.

Differential Revision: https://reviews.llvm.org/D157179


# 70d7ea0c 31-Jul-2023 Owen Pan <owenpiano@gmail.com>

[clang-format] Handle goto labels preceded by C++11 attributes

Fixes #64229.

Differential Revision: https://reviews.llvm.org/D156655


Revision tags: llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6
# 77a38f43 18-Nov-2022 Björn Schäpers <bjoern@hazardy.de>

[clang-format] Supress aligning of trailing namespace comments

Fixes https://github.com/llvm/llvm-project/issues/57504.

Differential Revision: https://reviews.llvm.org/D138263


# 400da115 01-Aug-2023 Galen Elias <galenelias@gmail.com>

[clang-format] Fix braced initializer with templated base class

Fixes #64134.

Differential Revision: https://reviews.llvm.org/D156705


12345678910>>...82