owenca wrote:
It seems
[AlignOperands](https://clang.llvm.org/docs/ClangFormatStyleOptions.html#alignoperands)
is supposed to do what this new option would, so maybe we should fix/extend
`AlignOperands` instead?
https://github.com/llvm/llvm-project/pull/95013
_
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/99433
Fixes #99271.
>From ebf25d890ff47be48bd153942d943906943a247b Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 17 Jul 2024 22:30:21 -0700
Subject: [PATCH] [clang-format] Fix a bug in annotating `*` in `#define`s
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/101291
Fixes #101138.
>From 0a162016899abb8a477e0fedad5be0416464ad4a Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 30 Jul 2024 23:20:12 -0700
Subject: [PATCH] [clang-format] Fix a misannotation of PointerOrReferen
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/101291
>From c59345d3b70a5343af22f78837ef8a47bea35e41 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 30 Jul 2024 23:20:12 -0700
Subject: [PATCH] [clang-format] Fix a misannotation of PointerOrReference
Fixes #10113
https://github.com/owenca closed
https://github.com/llvm/llvm-project/pull/101291
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/100852
>From f06f3ab5e59217348e72179c9581be338efa8789 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 26 Jul 2024 19:17:33 -0700
Subject: [PATCH] [clang-format] Handle parenthesized list in RemoveParentheses
Also, r
https://github.com/owenca demilestoned
https://github.com/llvm/llvm-project/pull/100852
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Owen Pan
Date: 2024-08-04T21:14:52-07:00
New Revision: d86a995ab78905cd055f8a93812c3b94cf042499
URL:
https://github.com/llvm/llvm-project/commit/d86a995ab78905cd055f8a93812c3b94cf042499
DIFF:
https://github.com/llvm/llvm-project/commit/d86a995ab78905cd055f8a93812c3b94cf042499.diff
LOG:
@@ -146,6 +147,33 @@ static bool startsNextParameter(const FormatToken &Current,
Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma));
}
+// Returns \c true if \c Token in an alignable binary operator
+static bool isAlignableBinaryOperator(const FormatToken
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca commented:
This patch also fixes #58014 and #57280, so you can include them in the commit
message.
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org
@@ -27630,6 +27630,245 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BreakBinaryOperations) {
+ auto Style = getLLVMStyleWithColumns(60);
+ // Logical operations
+ verifyFormat("if (condition1 && conditi
@@ -2231,6 +2231,41 @@ struct FormatStyle {
/// \version 3.7
bool BreakBeforeTernaryOperators;
+ /// Different ways to break binary operations.
+ enum BreakBinaryOperationsStyle : int8_t {
+/// Don't break binary operations
+/// \code
+///aaa + * ccc
@@ -2231,6 +2231,41 @@ struct FormatStyle {
/// \version 3.7
bool BreakBeforeTernaryOperators;
+ /// Different ways to break binary operations.
+ enum BreakBinaryOperationsStyle : int8_t {
+/// Don't break binary operations
+/// \code
+///aaa + * ccc
@@ -2231,6 +2231,41 @@ struct FormatStyle {
/// \version 3.7
bool BreakBeforeTernaryOperators;
+ /// Different ways to break binary operations.
+ enum BreakBinaryOperationsStyle : int8_t {
+/// Don't break binary operations
+/// \code
+///aaa + * ccc
@@ -27630,6 +27630,245 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BreakBinaryOperations) {
+ auto Style = getLLVMStyleWithColumns(60);
+ // Logical operations
+ verifyFormat("if (condition1 && conditi
@@ -27630,6 +27630,245 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BreakBinaryOperations) {
+ auto Style = getLLVMStyleWithColumns(60);
+ // Logical operations
owenca wrote:
```suggest
@@ -146,6 +147,33 @@ static bool startsNextParameter(const FormatToken &Current,
Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma));
}
+// Returns \c true if \c Token in an alignable binary operator
+static bool isAlignableBinaryOperator(const FormatToken
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
We should rename the option and its values to e.g. `BreakParameters` and
`Never`/`OnePerLine`/`Always`. See also
https://github.com/llvm/llvm-project/pull/95013#discussion_r1703578003.
https://github.com/llvm/llvm-project/pull/101882
__
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/102261
Fixes #102102.
>From b72a629d16d5bc3ce800a562fd41ba2dfd1fe1eb Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 6 Aug 2024 18:10:20 -0700
Subject: [PATCH] [clang-format] Fix a bug in annotating CastRParen
Fixe
owenca wrote:
> When you say rename, do you mean deprecate `BinPackParameters` like in these
> changes
> [6739bb5](https://github.com/llvm/llvm-project/commit/6739bb5006bc28e2bdbdb2326eb2c957546634aa)
> but using `BreakParameters` and `Never`/`OnePerLine`/`Always` for the names?
Yes, deprecat
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/97787
Fixes #97539.
>From 73d92b38268e5b44d6ed7e6ac9219267003cc7fb Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 4 Jul 2024 21:39:38 -0700
Subject: [PATCH] [clang-format] Skip block commented out includes when sor
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/97787
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/97938
None
>From eb53318b3c5dec2452c4a0d5aed7944ebdd99380 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 6 Jul 2024 22:21:26 -0700
Subject: [PATCH] [clang-format][NFC] Annotate function decl l_paren
---
clang/lib
@@ -803,6 +803,60 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState
&State, bool DryRun,
return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while,
tok::kw_switch);
};
+ // Detecting functions is brittle. It wo
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/97938
>From eb53318b3c5dec2452c4a0d5aed7944ebdd99380 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 6 Jul 2024 22:21:26 -0700
Subject: [PATCH 1/2] [clang-format][NFC] Annotate function decl l_paren
---
clang/lib/F
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/97938
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/97938
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -146,6 +146,14 @@ static bool startsNextParameter(const FormatToken &Current,
Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma));
}
+// Returns \c true if \c Current starts a new operand in a binary operation.
owenca wrote:
Did you me
@@ -3153,6 +3153,15 @@ class ExpressionParser {
parse(Precedence + 1);
int CurrentPrecedence = getCurrentPrecedence();
+ if (!Style.BinPackBinaryOperations &&
+ (CurrentPrecedence > prec::Conditional) &&
+ (CurrentPrecedence < prec::PointerTo
@@ -146,6 +146,14 @@ static bool startsNextParameter(const FormatToken &Current,
Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma));
}
+// Returns \c true if \c Current starts a new operand in a binary operation.
+static bool startsNextOperand(const Forma
@@ -146,6 +146,14 @@ static bool startsNextParameter(const FormatToken &Current,
Style.BreakInheritanceList != FormatStyle::BILS_BeforeComma));
}
+// Returns \c true if \c Current starts a new operand in a binary operation.
+static bool startsNextOperand(const Forma
@@ -27628,6 +27628,109 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BinPackBinaryOperations) {
+ auto Style = getLLVMStyleWithColumns(60);
+ // Logical operations
+ verifyFormat("if (condition1 && condi
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/98427
Fixes #92530.
>From fa1da3d06ed2207902df4911933bd40f0d514e51 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 10 Jul 2024 20:52:18 -0700
Subject: [PATCH] [clang-format] Fix a bug in TCAS_Leave using tabs for
i
https://github.com/owenca commented:
Also, we need ConfigParseTest for the new option.
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3153,6 +3153,15 @@ class ExpressionParser {
parse(Precedence + 1);
int CurrentPrecedence = getCurrentPrecedence();
+ if (!Style.BinPackBinaryOperations &&
+ (CurrentPrecedence > prec::Conditional) &&
+ (CurrentPrecedence < prec::PointerTo
@@ -27628,6 +27628,109 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BinPackBinaryOperations) {
+ auto Style = getLLVMStyleWithColumns(60);
+ // Logical operations
+ verifyFormat("if (condition1 && condi
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/94561
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/94548
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/92617
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca commented:
What happens if the comment is unindented, with and without an empty line below
it?
https://github.com/llvm/llvm-project/pull/94776
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
@@ -4828,7 +4833,10 @@ void UnwrappedLineParser::readToken(int LevelDifference)
{
PPBranchLevel > 0) {
Line->Level += PPBranchLevel;
}
- flushComments(isOnNewLine(*FormatTok));
+
+ if (!UnbracedBodyDepth)
owenca wrote:
Ditto.
@@ -796,6 +796,44 @@ TEST_F(FormatTestComments,
ParsesCommentsAdjacentToPPDirectives) {
format("namespace {}\n /* Test */#define A"));
}
+TEST_F(FormatTestComments, DeIdentsCommentBeforeIfdefAfterBracelessIf) {
+ verifyFormat("void f() {\n"
+
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/94776
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4811,8 +4813,11 @@ void UnwrappedLineParser::readToken(int LevelDifference)
{
(!Style.isVerilog() ||
Keywords.isVerilogPPDirective(*Tokens->peekNextToken())) &&
FirstNonCommentOnLine) {
- distributeComments(Comments, FormatTok);
-
@@ -338,6 +338,9 @@ class UnwrappedLineParser {
// `decltype(auto)`.
bool IsDecltypeAutoFunction = false;
+ // Current nesting depth within unbraced codeblocks.
owenca wrote:
```suggestion
// Nesting depth of unbraced body of a control statement.
```
@@ -796,6 +796,24 @@ TEST_F(FormatTestComments,
ParsesCommentsAdjacentToPPDirectives) {
format("namespace {}\n /* Test */#define A"));
}
+
+TEST_F(FormatTestComments, DeIdentsCommentBeforeIfdefAfterBracelessIf) {
+ EXPECT_EQ("void f() {\n"
owenca wrote:
This patch formats
```
void f() {
if (foo)
bar(); // Comment
#if BAZ
baz();
#endif
}
```
to
```
void f() {
if (foo)
bar();
// Comment
#if BAZ
baz();
#endif
}
```
The trailing comment shouldn't be wrapped.
https://github.com/llvm/llvm-project/pull/94776
_
@@ -22858,6 +22858,36 @@ TEST_F(FormatTest, FormatsLambdas) {
" //\n"
"});");
+ FormatStyle LLVMStyle = getLLVMStyleWithColumns(60);
+
+ verifyFormat("int main() {\n"
+ " very_long_function_name_yes_it_is_really_long(\n"
+ "
@@ -22858,6 +22858,36 @@ TEST_F(FormatTest, FormatsLambdas) {
" //\n"
"});");
+ FormatStyle LLVMStyle = getLLVMStyleWithColumns(60);
+
+ verifyFormat("int main() {\n"
+ " very_long_function_name_yes_it_is_really_long(\n"
+ "
@@ -1457,6 +1457,11 @@ unsigned ContinuationIndenter::getNewLineColumn(const
LineState &State) {
!Current.isOneOf(tok::colon, tok::comment)) {
return ContinuationIndent;
}
+ if (Current.is(TT_TrailingReturnArrow) &&
+ Previous.isOneOf(tok::kw_noexcept, tok::k
@@ -22858,6 +22858,36 @@ TEST_F(FormatTest, FormatsLambdas) {
" //\n"
"});");
+ FormatStyle LLVMStyle = getLLVMStyleWithColumns(60);
+
+ verifyFormat("int main() {\n"
+ " very_long_function_name_yes_it_is_really_long(\n"
+ "
owenca wrote:
> Technically also applies to attributes applied to the return type of the
> lambda, i.e.
>
> ```
> int main() {
> very_long_function_name_yes_it_is_really_long(
> // also happens with constexpr specifier
> [](auto n) [[attribute]]
> -> std::enable_if_t<
>
@@ -1864,7 +1894,11 @@ FormatStyle getWebKitStyle() {
Style.ObjCSpaceAfterProperty = true;
Style.PointerAlignment = FormatStyle::PAS_Left;
Style.SpaceBeforeCpp11BracedList = true;
- Style.SpaceInEmptyBlock = true;
+ Style.SpaceInEmptyBraces = FormatStyle::SIEBO_Custom;
owenca wrote:
> See [#93635
> (comment)](https://github.com/llvm/llvm-project/issues/93635#issuecomment-2138778128).
@khei4 maybe an `enum` for `SpaceInEmptyBraces` with `Always`, `Never`, and
`Custom`. (IMO `Leave` doesn't make sense.)
With `Custom`, a list of boolean suboptions e.g. `Functi
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/94560
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/94560
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/94560
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/94560
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/95084
Fixes #95072.
>From b89f8a5bcbf525d779565219951359162655929e Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 11 Jun 2024 01:32:32 -0700
Subject: [PATCH] [clang-format] Fix a bug in annotating lambda l_square
owenca wrote:
> Am I right that no one has a major issue with the patch? So fixing the
> "const" issue and adding a unit test will let that in?
Can you add a unit test?
https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-
owenca wrote:
@mydeveloperday requested it. See
https://github.com/llvm/llvm-project/pull/91317#pullrequestreview-2095010527.
There are calls to `getStyle()` in `ConfigParseTest.cpp`. Maybe add a test
there?
https://github.com/llvm/llvm-project/pull/91317
_
@@ -584,6 +584,23 @@ TEST_F(TokenAnnotatorTest,
UnderstandsNonTemplateAngleBrackets) {
EXPECT_TOKEN(Tokens[20], tok::greater, TT_BinaryOperator);
}
+TEST_F(TokenAnnotatorTest, UnderstandsTemplateTemplateParameters) {
+ auto Tokens = annotate("template typename X,\n"
+
@@ -127,7 +127,7 @@ class AnnotatingParser {
SmallVector &Scopes)
: Style(Style), Line(Line), CurrentToken(Line.First), AutoFound(false),
IsCpp(Style.isCpp()), LangOpts(getFormattingLangOpts(Style)),
-Keywords(Keywords), Scopes(Scopes) {
@@ -1269,10 +1269,17 @@ class AnnotatingParser {
if (CurrentToken && CurrentToken->is(tok::less)) {
CurrentToken->setType(TT_TemplateOpener);
next();
- if (!parseAngle())
+ TemplateDeclarationDepth++;
+ if (!parseAngle()) {
+TemplateDeclar
@@ -1269,10 +1269,17 @@ class AnnotatingParser {
if (CurrentToken && CurrentToken->is(tok::less)) {
CurrentToken->setType(TT_TemplateOpener);
next();
- if (!parseAngle())
+ TemplateDeclarationDepth++;
+ if (!parseAngle()) {
+TemplateDeclar
@@ -584,6 +584,23 @@ TEST_F(TokenAnnotatorTest,
UnderstandsNonTemplateAngleBrackets) {
EXPECT_TOKEN(Tokens[20], tok::greater, TT_BinaryOperator);
}
+TEST_F(TokenAnnotatorTest, UnderstandsTemplateTemplateParameters) {
+ auto Tokens = annotate("template typename X,\n"
+
@@ -584,6 +584,23 @@ TEST_F(TokenAnnotatorTest,
UnderstandsNonTemplateAngleBrackets) {
EXPECT_TOKEN(Tokens[20], tok::greater, TT_BinaryOperator);
}
+TEST_F(TokenAnnotatorTest, UnderstandsTemplateTemplateParameters) {
+ auto Tokens = annotate("template typename X,\n"
+
@@ -584,6 +584,23 @@ TEST_F(TokenAnnotatorTest,
UnderstandsNonTemplateAngleBrackets) {
EXPECT_TOKEN(Tokens[20], tok::greater, TT_BinaryOperator);
}
+TEST_F(TokenAnnotatorTest, UnderstandsTemplateTemplateParameters) {
+ auto Tokens = annotate("template typename X,\n"
+
https://github.com/owenca deleted
https://github.com/llvm/llvm-project/pull/95025
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/95084
>From b89f8a5bcbf525d779565219951359162655929e Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 11 Jun 2024 01:32:32 -0700
Subject: [PATCH 1/2] [clang-format] Fix a bug in annotating lambda l_square
Fixes #9507
@@ -1591,6 +1591,12 @@ TEST_F(TokenAnnotatorTest, UnderstandsLambdas) {
EXPECT_TOKEN(Tokens[15], tok::arrow, TT_TrailingReturnArrow);
EXPECT_TOKEN(Tokens[17], tok::l_brace, TT_LambdaLBrace);
+ Tokens = annotate("auto l = [] -> struct S { return {}; };");
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/95084
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1269,10 +1269,17 @@ class AnnotatingParser {
if (CurrentToken && CurrentToken->is(tok::less)) {
CurrentToken->setType(TT_TemplateOpener);
next();
- if (!parseAngle())
+ TemplateDeclarationDepth++;
+ if (!parseAngle()) {
+TemplateDeclar
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/95354
Fixes #45002.
>From 02f1731d57d40e51605f667c8a0b1223b159e645 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 12 Jun 2024 22:04:17 -0700
Subject: [PATCH] [clang-format] Don't overindent comment below unbraced b
owenca wrote:
@Erich-Reitz you were on the right track. See #95354.
https://github.com/llvm/llvm-project/pull/94776
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/95503
Closes #95094.
>From 6684ed759ce118bb28e9da22be51bcfece2a1909 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 13 Jun 2024 21:25:08 -0700
Subject: [PATCH] [clang-format] Handle AttributeMacro before access modi
@@ -1269,10 +1269,17 @@ class AnnotatingParser {
if (CurrentToken && CurrentToken->is(tok::less)) {
CurrentToken->setType(TT_TemplateOpener);
next();
- if (!parseAngle())
+ TemplateDeclarationDepth++;
+ if (!parseAngle()) {
+TemplateDeclar
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName,
StringRef FileName,
// Reset possible inheritance
Style.InheritsParentConfig = false;
- auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {};
-
auto applyChildFormatTexts = [&](FormatStyl
@@ -4027,12 +4031,10 @@ Expected getStyle(StringRef StyleName,
StringRef FileName,
// Reset possible inheritance
Style.InheritsParentConfig = false;
- auto dropDiagnosticHandler = [](const llvm::SMDiagnostic &, void *) {};
-
owenca wrote:
Sorry! We do n
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) {
ASSERT_EQ(*Style, getGoogleStyle());
}
+TEST(ConfigParseTest, GetStyleOutput) {
+// With output
+::testing::internal::CaptureStderr();
+llvm::vfs::InMemoryFileSystem FS;
+auto Style = getS
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) {
ASSERT_EQ(*Style, getGoogleStyle());
}
+TEST(ConfigParseTest, GetStyleOutput) {
+// With output
+::testing::internal::CaptureStderr();
+llvm::vfs::InMemoryFileSystem FS;
+auto Style = getS
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1452,6 +1452,35 @@ TEST(ConfigParseTest, GetStyleOfSpecificFile) {
ASSERT_EQ(*Style, getGoogleStyle());
}
+TEST(ConfigParseTest, GetStyleOutput) {
+// With output
+::testing::internal::CaptureStderr();
+llvm::vfs::InMemoryFileSystem FS;
+auto Style = getS
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/95354
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/91317
>From c1e0ad6ee57a95fa4321bbe91aa754167da9fb3b Mon Sep 17 00:00:00 2001
From: Artem Sokolovskii
Date: Tue, 7 May 2024 12:27:29 +0200
Subject: [PATCH 1/2] [clang-format] Add DiagHandler for getStyle function
It al
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/91317
>From c1e0ad6ee57a95fa4321bbe91aa754167da9fb3b Mon Sep 17 00:00:00 2001
From: Artem Sokolovskii
Date: Tue, 7 May 2024 12:27:29 +0200
Subject: [PATCH 1/3] [clang-format] Add DiagHandler for getStyle function
It al
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/91317
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/95634
Closes #95094.
>From 1c4ab4a5fd869de44795abd48bbaa43176e7275e Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 14 Jun 2024 23:36:58 -0700
Subject: [PATCH] [clang-format] Handle AttributeMacro before access modi
@@ -57,7 +57,10 @@ class LevelIndentTracker {
/// Update the indent state given that \p Line is going to be formatted
/// next.
void nextLine(const AnnotatedLine &Line) {
-Offset = getIndentOffset(*Line.First);
+const auto *Tok = Line.First;
+if (Tok->is(TT_At
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/95634
>From 1c4ab4a5fd869de44795abd48bbaa43176e7275e Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 14 Jun 2024 23:36:58 -0700
Subject: [PATCH 1/2] [clang-format] Handle AttributeMacro before access
modifiers
Clos
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/95634
>From 1c4ab4a5fd869de44795abd48bbaa43176e7275e Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 14 Jun 2024 23:36:58 -0700
Subject: [PATCH 1/3] [clang-format] Handle AttributeMacro before access
modifiers
Clos
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/95634
>From 1c4ab4a5fd869de44795abd48bbaa43176e7275e Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 14 Jun 2024 23:36:58 -0700
Subject: [PATCH 1/4] [clang-format] Handle AttributeMacro before access
modifiers
Clos
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/95634
>From 1c4ab4a5fd869de44795abd48bbaa43176e7275e Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 14 Jun 2024 23:36:58 -0700
Subject: [PATCH 1/5] [clang-format] Handle AttributeMacro before access
modifiers
Clos
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/95503
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
601 - 700 of 1001 matches
Mail list logo