https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/93140
___
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/93140
___
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/93140
___
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/93140
>From 09bd1f04730f0accad7ce041b0121f716cc7a18d Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 21 May 2024 22:21:59 -0600
Subject: [PATCH 01/13] [clang-format] Improve BlockIndent at ColumnLimit
Fixes #557
owenca wrote:
> Fixes #73584
Seems it's not fixed yet:
```
$ cat test.cpp
{
PyObjectPtr const readinto_method_obj{
PyObject_GetAttrString(input_stream, "readinto")};
}
$ clang-format test.cpp
{
PyObjectPtr const
readinto_method_obj{PyObject_GetAttrString(input_stream, "readi
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/93140
>From 09bd1f04730f0accad7ce041b0121f716cc7a18d Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 21 May 2024 22:21:59 -0600
Subject: [PATCH 01/12] [clang-format] Improve BlockIndent at ColumnLimit
Fixes #557
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/93140
>From 09bd1f04730f0accad7ce041b0121f716cc7a18d Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 21 May 2024 22:21:59 -0600
Subject: [PATCH 01/11] [clang-format] Improve BlockIndent at ColumnLimit
Fixes #557
@@ -9337,6 +9337,32 @@ TEST_F(FormatTest, AlignsAfterOpenBracket) {
"\n"
");",
Style);
+ verifyFormat("bool aaa(\n"
+ "const bool &a, const void *aa\n"
+ ") const {\n"
@@ -9337,6 +9337,32 @@ TEST_F(FormatTest, AlignsAfterOpenBracket) {
"\n"
");",
Style);
+ verifyFormat("bool aaa(\n"
+ "const bool &a, const void *aa\n"
+ ") const {\n"
owenca wrote:
Please also add the following:
```
$ git diff TokenAnnotatorTest.cpp
diff --git a/clang/unittests/Format/TokenAnnotatorTest.cpp
b/clang/unittests/Format/TokenAnnotatorTest.cpp
index c5e8aa72cd2c..4994498c389b 100644
--- a/clang/unittests/Format/TokenAnnotatorTest.cpp
+++ b/clang/un
@@ -803,6 +803,51 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState
&State, bool DryRun,
return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while,
tok::kw_switch);
};
+ auto IsLambdaParameterList = [](const Fo
@@ -803,6 +803,51 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState
&State, bool DryRun,
return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while,
tok::kw_switch);
};
+ auto IsLambdaParameterList = [](const Fo
@@ -803,6 +803,51 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState
&State, bool DryRun,
return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while,
tok::kw_switch);
};
+ auto IsLambdaParameterList = [](const Fo
@@ -803,6 +803,51 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState
&State, bool DryRun,
return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while,
tok::kw_switch);
};
+ auto IsLambdaParameterList = [](const Fo
@@ -813,10 +858,10 @@ void
ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
// cll(
// cll(
// caaall(aa,
a;
- Current.FakeLParen
@@ -803,6 +803,51 @@ void ContinuationIndenter::addTokenOnCurrentLine(LineState
&State, bool DryRun,
return !Tok.Previous->isOneOf(TT_CastRParen, tok::kw_for, tok::kw_while,
tok::kw_switch);
};
+ auto IsLambdaParameterList = [](const Fo
owenca wrote:
You can annotate the lambda l_paren:
```
$ git diff FormatToken.h
diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h
index cc45d5a8c5c1..abcedb66b57c 100644
--- a/clang/lib/Format/FormatToken.h
+++ b/clang/lib/Format/FormatToken.h
@@ -102,6 +102,7 @@ namesp
gedare wrote:
I have another PR lined up to submit but it depends on this one. It would be
great if we can get some forward progress @owenca
https://github.com/llvm/llvm-project/pull/93140
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https
gedare wrote:
Rebased to be able to use #97938
https://github.com/llvm/llvm-project/pull/93140
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -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/gedare updated
https://github.com/llvm/llvm-project/pull/93140
>From 6f35c68cff7381453a0bd6a491fee1db6784f42d Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 21 May 2024 22:21:59 -0600
Subject: [PATCH 1/5] [clang-format] Improve BlockIndent at ColumnLimit
Fixes #55731
@@ -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/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/93140
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -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/gedare updated
https://github.com/llvm/llvm-project/pull/93140
>From 27a2da876926d2157ea9f18c5fd71a2e81e097fc Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 21 May 2024 22:21:59 -0600
Subject: [PATCH 1/4] [clang-format] Improve BlockIndent at ColumnLimit
Fixes #55731
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -803,6 +803,46 @@ 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
@@ -803,6 +803,46 @@ 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/gedare updated
https://github.com/llvm/llvm-project/pull/93140
>From 27a2da876926d2157ea9f18c5fd71a2e81e097fc Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 21 May 2024 22:21:59 -0600
Subject: [PATCH 1/3] [clang-format] Improve BlockIndent at ColumnLimit
Fixes #55731
@@ -6157,6 +6157,12 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine
&Line,
return !(Previous && (Previous->is(tok::kw_for) || Previous->isIf()));
}
+ if (Left.isOneOf(tok::r_paren, TT_TrailingAnnotation) &&
gedare wrote:
yes, it is part of
@@ -803,6 +803,46 @@ 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
@@ -803,6 +803,46 @@ 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
@@ -6157,6 +6157,12 @@ bool TokenAnnotator::canBreakBefore(const AnnotatedLine
&Line,
return !(Previous && (Previous->is(tok::kw_for) || Previous->isIf()));
}
+ if (Left.isOneOf(tok::r_paren, TT_TrailingAnnotation) &&
HazardyKnusperkeks wrote:
Is this
https://github.com/gedare updated
https://github.com/llvm/llvm-project/pull/93140
>From 27a2da876926d2157ea9f18c5fd71a2e81e097fc Mon Sep 17 00:00:00 2001
From: Gedare Bloom
Date: Tue, 21 May 2024 22:21:59 -0600
Subject: [PATCH 1/2] [clang-format] Improve BlockIndent at ColumnLimit
Fixes #55731
github-actions[bot] wrote:
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
You can test this locally with the following command:
``bash
git-clang-format --diff 7f5c71efc441083282a5365d245acfe6afcd0dd5
27a2da876926d2157ea9f18c5fd71a2e81e097fc --
llvmbot wrote:
@llvm/pr-subscribers-clang-format
Author: Gedare Bloom (gedare)
Changes
Fixes #55731
Fixes #73584
The reported formatting problems were related to ignoring deep nesting of
"simple" functions (causing #54808) and to allowing the trailing
annotation to become separated fr
https://github.com/gedare created
https://github.com/llvm/llvm-project/pull/93140
Fixes #55731
Fixes #73584
The reported formatting problems were related to ignoring deep nesting of
"simple" functions (causing #54808) and to allowing the trailing annotation to
become separated from the clos
41 matches
Mail list logo