=?utf-8?q?Bj=C3=B6rn_Sch=C3=A4pers?=
Message-ID:
In-Reply-To:
https://github.com/owenca approved this pull request.
Good catch!
https://github.com/llvm/llvm-project/pull/81185
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -1010,7 +1010,8 @@ struct FormatStyle {
/// \version 3.7
DefinitionReturnTypeBreakingStyle AlwaysBreakAfterDefinitionReturnType;
- /// The function declaration return type breaking style to use.
+ /// The function declaration return type breaking style to use. This
owenca wrote:
@rmarker we only need to change the user-facing part and should leave the
internal naming unchanged (at least in this patch) in order to have the
smallest diff possible. I've added the support for deprecating/renaming
top-level struct-type options to `dump_format_style.py` in
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/81093
>From b9463c6664227edd6e579840292389909be04ab2 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 7 Feb 2024 22:43:15 -0800
Subject: [PATCH 1/3] [clang-format] Rename option
AlwaysBreakTemplateDeclarations
Drop
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/80241
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
/cherry-pick 8f6e13e6da84
https://github.com/llvm/llvm-project/pull/80628
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/owenca milestoned
https://github.com/llvm/llvm-project/pull/80628
___
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/81093
>From b9463c6664227edd6e579840292389909be04ab2 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 7 Feb 2024 22:43:15 -0800
Subject: [PATCH 1/2] [clang-format] Rename option
AlwaysBreakTemplateDeclarations
Drop
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/81093
Drop the "Always" prefix to remove the self-contradiction.
>From b9463c6664227edd6e579840292389909be04ab2 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 7 Feb 2024 22:43:15 -0800
Subject: [PATCH]
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/80628
___
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/80569
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,5 +1,8 @@
+// RUN: clang-format -assume-filename=foo.m -dump-config | FileCheck %s
owenca wrote:
Yes, because it wouldn't make a difference before and after the patch. I don't
think we can use lit to test that behavior (i.e., not waiting for an EOF) of
Author: Owen Pan
Date: 2024-02-06T09:00:15-08:00
New Revision: a628f68a9c4ce6f3dcd0c8bb3650db45671ed15a
URL:
https://github.com/llvm/llvm-project/commit/a628f68a9c4ce6f3dcd0c8bb3650db45671ed15a
DIFF:
https://github.com/llvm/llvm-project/commit/a628f68a9c4ce6f3dcd0c8bb3650db45671ed15a.diff
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:
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 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
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
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
@@ -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)");
+
+
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
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 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 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
@@ -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
@@ -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"
+"//
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
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
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 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
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
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
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 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
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
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
@@ -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"
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
@@ -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 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
@@ -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"
@@ -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
owenca wrote:
Should we merge this patch?
https://github.com/llvm/llvm-project/pull/78847
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -922,8 +922,39 @@ struct FormatStyle {
/// };
/// int f();
/// int f() { return 1; }
+/// int LongName::
+/// AnotherLongName();
/// \endcode
RTBS_None,
+/// Break after return type automatically.
+/// This mode doesn't
https://github.com/owenca commented:
There is no need to update the release notes for new option values.
https://github.com/llvm/llvm-project/pull/78011
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
@@ -922,8 +922,39 @@ struct FormatStyle {
/// };
/// int f();
/// int f() { return 1; }
+/// int LongName::
+/// AnotherLongName();
/// \endcode
RTBS_None,
+/// Break after return type automatically.
+/// This mode doesn't
@@ -922,8 +922,39 @@ struct FormatStyle {
/// };
/// int f();
/// int f() { return 1; }
+/// int LongName::
+/// AnotherLongName();
/// \endcode
owenca wrote:
Change the comments (lines 917-927) to something like the
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
@@ -922,8 +922,39 @@ struct FormatStyle {
/// };
/// int f();
/// int f() { return 1; }
+/// int LongName::
+/// AnotherLongName();
/// \endcode
RTBS_None,
+/// Break after return type automatically.
+/// This mode doesn't
owenca wrote:
> Now that we've got both options, should we keep them? Currently, `None`
> sometimes forbids breaking after short return types and sometimes allows it
> and just bases things off the penalty configuration. I feel like there will
> be some people who use `None` who would want
owenca wrote:
See #80241.
https://github.com/llvm/llvm-project/pull/79115
___
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/79115
___
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/80241
Now with a8279a8bc541, we can make the update.
>From fda19165bc1195be01159c7d071839822ff3f929 Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Wed, 31 Jan 2024 20:43:29 -0800
Subject: [PATCH] [clang-format] Update
https://github.com/owenca closed 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
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/80101
___
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/80101
>From f3ad3ceebba663615e75b5a6fc8969f4a98a03ea Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 30 Jan 2024 19:11:30 -0800
Subject: [PATCH 1/2] [clang][NFC] Move isSimpleTypeSpecifier() from Sema to
Token
So
https://github.com/owenca updated
https://github.com/llvm/llvm-project/pull/79115
>From f3ad3ceebba663615e75b5a6fc8969f4a98a03ea Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 30 Jan 2024 19:11:30 -0800
Subject: [PATCH 1/2] [clang][NFC] Move isSimpleTypeSpecifier() from Sema to
Token
So
https://github.com/owenca edited https://github.com/llvm/llvm-project/pull/79115
___
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/79115
>From f3ad3ceebba663615e75b5a6fc8969f4a98a03ea Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 30 Jan 2024 19:11:30 -0800
Subject: [PATCH] [clang][NFC] Move isSimpleTypeSpecifier() from Sema to Token
So that
https://github.com/owenca created
https://github.com/llvm/llvm-project/pull/80101
So that it can be used by clang-format.
>From f3ad3ceebba663615e75b5a6fc8969f4a98a03ea Mon Sep 17 00:00:00 2001
From: Owen Pan
Date: Tue, 30 Jan 2024 19:11:30 -0800
Subject: [PATCH] [clang][NFC] Move
https://github.com/owenca approved this pull request.
https://github.com/llvm/llvm-project/pull/80085
___
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/79037
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
owenca wrote:
> Let's leave `None` alone and add `ExceptShortType`
I meant to add `ExceptShortType` instead of `AllowShortType`. Sorry I didn't
realize that adding `AllowShortType` and making it to mean "not `None`" might
work, in which case we don't need to add `ExceptShortType`.
@@ -1760,8 +1760,8 @@ void UnwrappedLineParser::parseStructuralElement(
break;
}
case tok::kw_enum:
- // Ignore if this is part of "template is(tok::less)) {
+ // Ignore if this is part of "template enum".
+ if (Previous &&
https://github.com/owenca closed https://github.com/llvm/llvm-project/pull/79805
___
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/79805
___
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/79037
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
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
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
) {
// Don't break after very short return
@@ -1694,8 +1694,11 @@ void
ContinuationIndenter::moveStatePastFakeLParens(LineState ,
// Special case for generic selection expressions, its comma-separated
// expressions are not aligned to the opening paren like regular calls, but
// rather
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
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
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
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.
@@ -587,7 +590,7 @@ bool ContinuationIndenter::mustBreak(const LineState
) {
!State.Line->ReturnTypeWrapped &&
// Don't break before a C# function when no break after return type.
(!Style.isCSharp() ||
- Style.AlwaysBreakAfterReturnType !=
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
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
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
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
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
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
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
@@ -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:
+
@@ -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
@@ -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
@@ -2636,7 +2636,7 @@ class Sema final {
void DiagnoseUseOfUnimplementedSelectors();
- bool isSimpleTypeSpecifier(tok::TokenKind Kind) const;
+ bool isSimpleTypeSpecifier(Token ) const;
owenca wrote:
```suggestion
bool isSimpleTypeSpecifier(const
@@ -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:
+
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
@@ -326,11 +326,13 @@ bool ContinuationIndenter::canBreak(const LineState
) {
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) {
-if
@@ -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
@@ -9938,12 +9980,19 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
"return 1;\n"
" }\n"
" int 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"
+ " "
+
@@ -9891,13 +9912,20 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
" }\n"
" int\n"
" g();\n"
+ " long\n"
+ " "
+ "fooo::"
@@ -587,7 +589,9 @@ bool ContinuationIndenter::mustBreak(const LineState
) {
!State.Line->ReturnTypeWrapped &&
// Don't break before a C# function when no break after return type.
(!Style.isCSharp() ||
- Style.AlwaysBreakAfterReturnType !=
@@ -9906,12 +9934,19 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
verifyFormat("class B {\n"
" int f() { return 1; }\n"
" int g();\n"
+ " long\n"
+ " "
+
@@ -9872,9 +9872,30 @@ TEST_F(FormatTest, ReturnTypeBreakingStyle) {
verifyFormat("class A {\n"
" int f() { return 1; }\n"
" int g();\n"
+ " long fooo::\n"
+ "
@@ -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
+///
501 - 600 of 1303 matches
Mail list logo