@@ -914,16 +914,31 @@ struct FormatStyle {
/// Different ways to break after the function definition or
/// declaration return type.
enum ReturnTypeBreakingStyle : int8_t {
-/// Break after return type automatically.
-/// ``PenaltyReturnTypeOnItsOwnLine`` is taken
@@ -9920,13 +9962,17 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
verifyFormat("class C {\n"
" int f() { return 1; }\n"
" int g();\n"
+ " long\n"
+ " f::br();\n"
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/78011
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -9906,12 +9944,16 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
verifyFormat("class B {\n"
" int f() { return 1; }\n"
" int g();\n"
+ " long\n"
+ " f::br();\n"
@@ -9938,12 +9984,16 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
"return 1;\n"
" }\n"
" int g();\n"
+ " long\n"
+ " f::br();\n"
@@ -9906,12 +9944,16 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
verifyFormat("class B {\n"
" int f() { return 1; }\n"
" int g();\n"
+ " long\n"
+ " f::br();\n"
https://github.com/owenca commented:
Looks good otherwise.
https://github.com/llvm/llvm-project/pull/78011
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -9938,12 +9984,16 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
"return 1;\n"
" }\n"
" int g();\n"
+ " long\n"
+ " f::br();\n"
@@ -9906,12 +9944,16 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
verifyFormat("class B {\n"
" int f() { return 1; }\n"
" int g();\n"
+ " long\n"
+ " f::br();\n"
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/78011
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
I don't think the buildkite failure is related to this PR, but I like to wait
for a couple of days before merging in case others have any comments.
https://github.com/llvm/llvm-project/pull/78011
___
cfe-commits mailing list
cfe-commits@
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/80569
Now with a8279a8bc541, we can make the update.
>From 45b720cbda6b08ca55b7d131bb0541f38f36e7c9 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 3 Feb 2024 16:01:49 -0800
Subject: [PATCH] [clang-format] Add Leave
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/80569
___
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/80569
>From 4ce4a4ff922f393398bf62746fc59749f1679247 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 3 Feb 2024 16:01:49 -0800
Subject: [PATCH] [clang-format] Add Leave to AlwaysBreakTemplateDeclarations
Closes #780
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/80569
>From 89ab06f93817a6d0e68f0549cae8836e6fd17612 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sat, 3 Feb 2024 16:01:49 -0800
Subject: [PATCH] [clang-format] Add Leave to AlwaysBreakTemplateDeclarations
Closes #780
https://github.com/owenca milestoned
https://github.com/llvm/llvm-project/pull/79549
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
/cherry-pick f826f55b2ab6
https://github.com/llvm/llvm-project/pull/79549
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca unassigned
https://github.com/llvm/llvm-project/pull/79549
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca demilestoned
https://github.com/llvm/llvm-project/pull/79549
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1909,6 +1909,14 @@ TEST_F(FormatTestComments, ReflowsComments) {
"// @param arg",
getLLVMStyleWithColumns(20)));
+ // Don't reflow lines starting with '\'.
+ EXPECT_EQ("// long long long\n"
+"// long\n"
+"// \
@@ -1909,6 +1909,14 @@ TEST_F(FormatTestComments, ReflowsComments) {
"// @param arg",
getLLVMStyleWithColumns(20)));
+ // Don't reflow lines starting with '\'.
+ EXPECT_EQ("// long long long\n"
owenca wrote:
Can you use
https://github.com/owenca deleted
https://github.com/llvm/llvm-project/pull/80381
___
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/80381
___
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/80381
___
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/78011
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -24160,6 +24160,14 @@ TEST_F(FormatTest, AlternativeOperators) {
verifyFormat("int a compl(5);");
verifyFormat("int a not(5);");
+ verifyFormat("v(not)");
+ verifyFormat("v(not!)");
+ verifyFormat("Symbol(not, None)");
+ verifyFormat("Symbol(not!, None)");
+
+ veri
owenca wrote:
@bhamiltoncx Thanks for the fix! Nevertheless, it seems that this triggered a
new regression. See #80621.
https://github.com/llvm/llvm-project/pull/79051
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/80628
Commit d813af73f70f addressed a regression introduced by commit 3791b3fca6ea
but caused `clang-format -dump-config` to "hang".
This patch reverts changes to ClangFormat.cpp by both 3791b3fca6ea and
d813af73f70f an
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/80628
>From d49f94ca7de184fb7859a2d6d3f85e9b9adcc041 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sun, 4 Feb 2024 18:29:42 -0800
Subject: [PATCH 1/2] [clang-format] Fix a regression in dumping the config
Commit d813af
owenca wrote:
Probably. See #80628 for a fix.
https://github.com/llvm/llvm-project/pull/79051
___
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/78752
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
See
https://discourse.llvm.org/t/should-issimpletypespecifier-return-true-for-bool/74873/16.
https://github.com/llvm/llvm-project/pull/79037
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/l
@@ -1157,7 +1157,15 @@ void UnwrappedLineParser::parsePPDefine() {
// guard processing above, and changes preprocessing nesting.
FormatTok->Tok.setKind(tok::identifier);
FormatTok->Tok.setIdentifierInfo(Keywords.kw_internal_ident_after_define);
- nextToken();
+
+ if (St
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/79549
Fixes #78965.
>From 550ab825a339307ecf2f02fe12ba987ab1351bf9 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 25 Jan 2024 20:16:37 -0800
Subject: [PATCH] [clang-format] Fix a bug in
AnnotatingParser::rParenEnd
owenca wrote:
> This would be greatly simplified if we can annotate the `DoubleParenthesis`
> situation inside of `UnwrappedLineParser::parseParens`.
+1.
https://github.com/llvm/llvm-project/pull/77522
___
cfe-commits mailing list
cfe-commits@lists.l
@@ -4569,23 +4602,40 @@ struct FormatStyle {
bool InEmptyParentheses;
/// Put a space in parentheses not covered by preceding options.
/// \code
-///true: false:
-///t f( Deleted & ) & = delete; vs. t f(Deleted
@@ -4542,18 +4542,51 @@ struct FormatStyle {
/// Other: true
/// \endcode
struct SpacesInParensCustom {
+/// Override any of the following options to prevent addition of space
+/// between the first two parentheses in situations where a pair of
+/// parent
@@ -4569,23 +4602,40 @@ struct FormatStyle {
bool InEmptyParentheses;
/// Put a space in parentheses not covered by preceding options.
/// \code
-///true: false:
-///t f( Deleted & ) & = delete; vs. t f(Deleted
@@ -9872,9 +9872,30 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
verifyFormat("class A {\n"
" int f() { return 1; }\n"
" int g();\n"
+ " long fooo::\n"
+ " ba
@@ -9906,12 +9934,19 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
verifyFormat("class B {\n"
" int f() { return 1; }\n"
" int g();\n"
+ " long\n"
+ " "
+ "f
@@ -587,7 +589,9 @@ bool ContinuationIndenter::mustBreak(const LineState
&State) {
!State.Line->ReturnTypeWrapped &&
// Don't break before a C# function when no break after return type.
(!Style.isCSharp() ||
- Style.AlwaysBreakAfterReturnType != FormatS
@@ -9891,13 +9912,20 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
" }\n"
" int\n"
" g();\n"
+ " long\n"
+ " "
+ "fooo::"
@@ -9920,13 +9955,20 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
verifyFormat("class C {\n"
" int f() { return 1; }\n"
" int g();\n"
+ " long\n"
+ " "
+ "f
@@ -9938,12 +9980,19 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
"return 1;\n"
" }\n"
" int g();\n"
+ " long\n"
+ " "
+ "fooo::"
-
@@ -146,7 +146,7 @@ the configuration (without a prefix: ``Auto``).
.. _BasedOnStyle:
-**BasedOnStyle** (``String``) :ref:`¶ `
+**BasedOnStyle** (``String``) :ref:`¶ `
owenca wrote:
```suggestion
**BasedOnStyle** (``String``) :ref:`¶ `
```
Was this genera
@@ -326,11 +326,13 @@ bool ContinuationIndenter::canBreak(const LineState
&State) {
return false;
}
- // Don't break after very short return types (e.g. "void") as that is often
- // unexpected.
- if (Current.is(TT_FunctionDeclarationName) && State.Column < 6) {
-
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/79549
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -156,24 +161,19 @@ bool Sema::isSimpleTypeSpecifier(tok::TokenKind Kind)
const {
#define TRANSFORM_TYPE_TRAIT_DEF(_, Trait) case tok::kw___##Trait:
#include "clang/Basic/TransformTypeTraits.def"
case tok::kw___auto_type:
-return true;
-
- case tok::annot_typename:
+
@@ -2636,7 +2636,7 @@ class Sema final {
void DiagnoseUseOfUnimplementedSelectors();
- bool isSimpleTypeSpecifier(tok::TokenKind Kind) const;
+ bool isSimpleTypeSpecifier(Token &Tok) const;
owenca wrote:
```suggestion
bool isSimpleTypeSpecifier(const T
@@ -128,10 +128,15 @@ class TypeNameValidatorCCC final : public
CorrectionCandidateCallback {
} // end anonymous namespace
/// Determine whether the token kind starts a simple-type-specifier.
-bool Sema::isSimpleTypeSpecifier(tok::TokenKind Kind) const {
+bool Sema::isSimpleT
@@ -196,6 +196,13 @@ class Token {
PtrData = (void*) II;
}
+ bool hasIdentifierInfo() {
+if (is(tok::raw_identifier) || isAnnotation() || isLiteral() ||
+is(tok::eof))
+ return false;
+return true;
+ }
+
owenca wrote:
IMO we don't
@@ -156,24 +161,19 @@ bool Sema::isSimpleTypeSpecifier(tok::TokenKind Kind)
const {
#define TRANSFORM_TYPE_TRAIT_DEF(_, Trait) case tok::kw___##Trait:
#include "clang/Basic/TransformTypeTraits.def"
case tok::kw___auto_type:
-return true;
-
- case tok::annot_typename:
+
owenca wrote:
This would break polly:
```
$ ninja polly-check-format
[27/105] Checking format of /Users/Owe...ude/polly/CodeGen/BlockGenerators.h...
FAILED: tools/polly/polly-check-format1
/Users/Owen/llvm-project/build/tools/polly/polly-check-format1
cd /Users/Owen/llvm-project/build/tools/pol
owenca wrote:
OTOH, if we change `LLVMStyle.AlwaysBreakAfterReturnType` to
`RTBS_AllowShortType`, we get the following:
```
$ ninja polly-check-format
[24/105] Checking format of /Users/Owe...olly/include/polly/DependenceInfo.h...
FAILED: tools/polly/polly-check-format16
/Users/Owen/llvm-projec
owenca wrote:
@llvm/pr-subscribers-clang-format this patch fixes a very old bug and will
cause behavior changes whether the default is changed to the new
`AllowShortType` or left at `None`. Which way should we go?
https://github.com/llvm/llvm-project/pull/78011
Author: Owen Pan
Date: 2024-01-27T21:21:01-08:00
New Revision: 179ade6a6d78533179205640dd161bf179daa9ee
URL:
https://github.com/llvm/llvm-project/commit/179ade6a6d78533179205640dd161bf179daa9ee
DIFF:
https://github.com/llvm/llvm-project/commit/179ade6a6d78533179205640dd161bf179daa9ee.diff
LOG:
owenca wrote:
LGTM, but please rebase and resolve conflicts.
https://github.com/llvm/llvm-project/pull/79037
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> What would change if the default was kept at `None`? I don't see it.
See https://github.com/llvm/llvm-project/pull/78011#issuecomment-1913052884.
https://github.com/llvm/llvm-project/pull/78011
___
cfe-commits mailing list
cfe-commits@
owenca wrote:
> @mydeveloperday @HazardyKnusperkeks @rymiel this patch fixes a very old bug
> and will cause behavior changes whether the default is changed to the new
> `AllowShortType` or left at `None`. Which way should we go?
Now I'm leaning toward keeping the existing (buggy) behavior of
@@ -587,7 +590,7 @@ bool ContinuationIndenter::mustBreak(const LineState
&State) {
!State.Line->ReturnTypeWrapped &&
// Don't break before a C# function when no break after return type.
(!Style.isCSharp() ||
- Style.AlwaysBreakAfterReturnType != FormatS
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/79796
Change AfterPlacementOperator to a boolean. Also add SBPO_None for never
inserting a space before a left parenthesis and deprecate SBPO_Never, which
meant never inserting a space except when after new/delete.
Fi
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/79796
>From d40f2ed71e72c9cee266e63abbae4b9aac1de47c Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Mon, 29 Jan 2024 00:43:19 -0800
Subject: [PATCH] [clang-format] Simplify the AfterPlacementOperator option
Change After
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/79796
>From d40f2ed71e72c9cee266e63abbae4b9aac1de47c Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Mon, 29 Jan 2024 00:43:19 -0800
Subject: [PATCH 1/2] [clang-format] Simplify the AfterPlacementOperator option
Change A
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/79796
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1694,8 +1694,11 @@ void
ContinuationIndenter::moveStatePastFakeLParens(LineState &State,
// Special case for generic selection expressions, its comma-separated
// expressions are not aligned to the opening paren like regular calls, but
// rather continuation-in
owenca wrote:
Let's leave `None` alone and add `ExceptShortType`, e.g.:
```
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -329,12 +329,18 @@ bool ContinuationIndenter::canBreak(const LineState
&State) {
// Don't break after very short retur
owenca wrote:
> Does it look like a genuine failure I should address or a spurious build
> quirk?
The latter.
https://github.com/llvm/llvm-project/pull/79037
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailm
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/79037
___
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/76804
___
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/77723
___
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/77977
None
>From 4f516c1ee4ab99af2c3135ca161a82e6428d3ee9 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Fri, 12 Jan 2024 12:30:17 -0800
Subject: [PATCH] [clang-format][NFC] Use FileCheck for clang-format-ignore lit
te
owenca wrote:
See #77977.
https://github.com/llvm/llvm-project/pull/76733
___
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/77977
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4842,7 +4842,7 @@ bool TokenAnnotator::spaceRequiredBefore(const
AnnotatedLine &Line,
return true;
}
if (Left.is(TT_UnaryOperator)) {
-if (Right.isNot(tok::l_paren)) {
+if (!Right.isOneOf(tok::r_paren, tok::l_paren, tok::exclaim)) {
owenca
owenca wrote:
> I think this is kind of too specific.
+1.
> Also I agree with [#78166
> (comment)](https://github.com/llvm/llvm-project/issues/78166#issuecomment-1892311219)
> that `WhitespaceSensitiveMacros` should be used.
I don't think we should require that the option be used.
https://g
owenca wrote:
This should work:
```
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -4402,9 +4402,17 @@ bool TokenAnnotator::spaceRequiredBefore(const
AnnotatedLine &Line,
if (Left.Finalized)
return Right.hasWhitespaceBefore();
- // Never ever me
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/70338
>From 25ca978ef9caf372997f2ebf227fb2b2ca443aa0 Mon Sep 17 00:00:00 2001
From: Tomek Paszek
Date: Sat, 11 Nov 2023 19:38:00 +0100
Subject: [PATCH 01/15] Added an option to ignore macro definitions.
---
clang/incl
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/78682
Closes #67991.
Co-authored-by: @tomekpaszek
>From 620e614b242055c3b8cbd81efd9bbc64a0ee4e56 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Thu, 18 Jan 2024 23:34:13 -0800
Subject: [PATCH] [clang-format] Option to
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/78682
___
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/78682
___
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/70338
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,27 @@
+// Test the combination of regrouped include directives, via regexes and
owenca wrote:
> Ok I will move them there, thanks :) Should I remove these lit tests or are
> they complementary?
Please remove them from the lit tests.
https://github.c
@@ -1366,11 +1366,12 @@ void
WhitespaceManager::alignArrayInitializersLeftJustified(
auto &Cells = CellDescs.Cells;
// Now go through and fixup the spaces.
auto *CellIter = Cells.begin();
- // The first cell needs to be against the left brace.
- if (Changes[CellIter->I
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/77868
___
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/77868
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -14583,9 +14583,10 @@ TEST_F(FormatTest,
UnderstandContextOfRecordTypeKeywords) {
verifyFormat("template <> struct X < 15, i<3 && 42 < 50 && 33 < 28> {};");
verifyFormat("int i = SomeFunction(a b);");
- // FIXME:
- // This now gets parsed incorrectly as class definit
owenca wrote:
> Covering all double parens in a single sub-option is not precise enough for
> code bases that may want to have `__attribute__(( x ))` but also allow `if (
> ( x ) )`.
We should not go overboard with supporting all kinds of options/suboptions
imaginable. I don't think we should
@@ -768,15 +768,25 @@ void
ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
// parenthesis by disallowing any further line breaks if there is no line
// break after the opening parenthesis. Don't break if it doesn't conserve
// columns.
+ const
@@ -768,15 +768,25 @@ void
ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
// parenthesis by disallowing any further line breaks if there is no line
// break after the opening parenthesis. Don't break if it doesn't conserve
// columns.
+ const
@@ -3873,6 +3873,9 @@ void UnwrappedLineParser::parseRecord(bool ParseAsExpr) {
const FormatToken &InitialToken = *FormatTok;
nextToken();
+ auto IsNonMacroIdentifier = [](FormatToken *Tok) {
owenca wrote:
Nit:
```suggestion
auto IsNonMacroIdentifier =
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/77013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> The code is [self-hosted](https://git.rtems.org/rtems/) and [mirrored on
> GitHub](https://github.com/RTEMS/rtems) with a [documented style
> guide](https://docs.rtems.org/branches/master/eng/coding-formatting.html). In
> addition, I have been and will continue to be willing to
owenca wrote:
> > Would `__attribute__((noreturn))`, `if ((i = j))`, `decltype((x))`, and
> > `while (((i + 1) * j - 2) * k > 3)` be formatted as `__attribute__((
> > noreturn ))`, `if (( i = j ))`, `decltype(( x ))`, and `while ( ( ( i + 1 )
> > * j - 2 ) * k > 3 )`, respectively?
>
> Almost
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/78921
Fixes #76991.
>From bc3f566b7c512434179241796a2d7d4ac3e7b381 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Sun, 21 Jan 2024 17:14:53 -0800
Subject: [PATCH] [clang-format] Fix a bug in ContinuationIndenter
Fixes
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/77699
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> > It seems adding a boolean sub-option that targets double pairs of
> > parentheses as I suggested before is feasible although a better name than
> > `ConsecutiveParentheses` may be needed.
>
> I'm fine to fix but request a concrete suggestion or proposal before I spend
> much
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest,
UnderstandsRequiresClausesAndConcepts) {
"concept C = (!Foo) && Bar;");
owenca wrote:
+1. You don't even need to create a pull request for this kind of NFC changes.
https://github.com/llvm/l
@@ -1071,6 +1071,37 @@ TEST_F(TokenAnnotatorTest,
UnderstandsRequiresClausesAndConcepts) {
"concept C = (!Foo) && Bar;");
ASSERT_EQ(Tokens.size(), 19u) << Tokens;
EXPECT_TOKEN(Tokens[15], tok::ampamp, TT_BinaryOperator);
+
+ Tokens = annotate("void f()
@@ -1071,6 +1071,16 @@ TEST_F(TokenAnnotatorTest,
UnderstandsRequiresClausesAndConcepts) {
"concept C = (!Foo) && Bar;");
ASSERT_EQ(Tokens.size(), 19u) << Tokens;
EXPECT_TOKEN(Tokens[15], tok::ampamp, TT_BinaryOperator);
+
+ Tokens = annotate("void f()
owenca wrote:
> @mydeveloperday, do you have an opinion on this pull request? It addresses
> #78010 with minimal changes, or are you interested in exploring other
> possibilities?
It's weird to add such a top-level option to fix a bug and keep the current
behavior. See
https://github.com/llv
501 - 600 of 2500 matches
Mail list logo