Author: Björn Schäpers
Date: 2023-08-02T11:50:14+02:00
New Revision: 2c3b12b5418fa4aa3aeb3f2154ae7bedbd1feac8
URL:
https://github.com/llvm/llvm-project/commit/2c3b12b5418fa4aa3aeb3f2154ae7bedbd1feac8
DIFF:
https://github.com/llvm/llvm-project/commit/2c3b12b5418fa4aa3aeb3f2154ae7bedbd1feac8.diff
Author: Björn Schäpers
Date: 2023-08-02T11:50:14+02:00
New Revision: f274ffc3034192179de14edb3be1ed85615aac42
URL:
https://github.com/llvm/llvm-project/commit/f274ffc3034192179de14edb3be1ed85615aac42
DIFF:
https://github.com/llvm/llvm-project/commit/f274ffc3034192179de14edb3be1ed85615aac42.diff
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/65409
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks review_requested
https://github.com/llvm/llvm-project/pull/65808
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks review_requested
https://github.com/llvm/llvm-project/pull/65808
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks created
https://github.com/llvm/llvm-project/pull/65808:
It really bugs me that it breaks to
``` c++
...) noexcept(
noexcept(condition)...
```
This is a fix for people like me.
From d0415b4436a11e649fbeae53b8060f70bae03254 Mon Sep 17 00:00:00 2001
From
https://github.com/HazardyKnusperkeks resolved
https://github.com/llvm/llvm-project/pull/65808
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks updated
https://github.com/llvm/llvm-project/pull/65808:
From d0415b4436a11e649fbeae53b8060f70bae03254 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?=
Date: Fri, 8 Sep 2023 13:07:09 +0200
Subject: [PATCH 1/2] [clang-format] BreakBefore
https://github.com/HazardyKnusperkeks updated
https://github.com/llvm/llvm-project/pull/65808:
From 3d3b20f66212f86bd46853432f1be31e5977df83 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?=
Date: Fri, 8 Sep 2023 13:07:09 +0200
Subject: [PATCH] [clang-format] BreakBeforeNoex
https://github.com/HazardyKnusperkeks closed
https://github.com/llvm/llvm-project/pull/65808
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/65861
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1016,6 +1016,14 @@ TEST_F(TokenAnnotatorTest,
UnderstandsRequiresClausesAndConcepts) {
ASSERT_EQ(Tokens.size(), 22u) << Tokens;
EXPECT_TOKEN(Tokens[4], tok::kw_requires, TT_RequiresClause);
EXPECT_TOKEN(Tokens[10], tok::ampamp, TT_PointerOrReference);
+
+ Tokens = a
https://github.com/HazardyKnusperkeks requested changes to this pull request.
https://github.com/llvm/llvm-project/pull/65908
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1016,6 +1016,14 @@ TEST_F(TokenAnnotatorTest,
UnderstandsRequiresClausesAndConcepts) {
ASSERT_EQ(Tokens.size(), 22u) << Tokens;
EXPECT_TOKEN(Tokens[4], tok::kw_requires, TT_RequiresClause);
EXPECT_TOKEN(Tokens[10], tok::ampamp, TT_PointerOrReference);
+
+ Tokens = a
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/65908
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3369,9 +3369,13 @@ bool clang::format::UnwrappedLineParser::parseRequires()
{
case tok::kw_volatile:
case tok::kw_const:
case tok::comma:
- FormatTok = Tokens->setPosition(StoredPosition);
- parseRequiresExpression(RequiresToken);
- return false;
@@ -3369,9 +3369,13 @@ bool clang::format::UnwrappedLineParser::parseRequires()
{
case tok::kw_volatile:
case tok::kw_const:
case tok::comma:
- FormatTok = Tokens->setPosition(StoredPosition);
- parseRequiresExpression(RequiresToken);
- return false;
Author: Björn Schäpers
Date: 2023-07-12T12:23:19+02:00
New Revision: 1116ed2beb1cd62a4b450efead481009af19df62
URL:
https://github.com/llvm/llvm-project/commit/1116ed2beb1cd62a4b450efead481009af19df62
DIFF:
https://github.com/llvm/llvm-project/commit/1116ed2beb1cd62a4b450efead481009af19df62.diff
Author: Björn Schäpers
Date: 2023-07-12T12:23:20+02:00
New Revision: ce7356f08194083c205b92e77d1a4cd515a2a5b8
URL:
https://github.com/llvm/llvm-project/commit/ce7356f08194083c205b92e77d1a4cd515a2a5b8
DIFF:
https://github.com/llvm/llvm-project/commit/ce7356f08194083c205b92e77d1a4cd515a2a5b8.diff
Author: Björn Schäpers
Date: 2023-08-24T08:34:22+02:00
New Revision: 6e77ba6c1e4d2945a37169f6c7b3531ba39898b5
URL:
https://github.com/llvm/llvm-project/commit/6e77ba6c1e4d2945a37169f6c7b3531ba39898b5
DIFF:
https://github.com/llvm/llvm-project/commit/6e77ba6c1e4d2945a37169f6c7b3531ba39898b5.diff
Author: Björn Schäpers
Date: 2023-08-29T21:59:44+02:00
New Revision: ca0aa533656ceb806d2744c38766f70c317f1053
URL:
https://github.com/llvm/llvm-project/commit/ca0aa533656ceb806d2744c38766f70c317f1053
DIFF:
https://github.com/llvm/llvm-project/commit/ca0aa533656ceb806d2744c38766f70c317f1053.diff
https://github.com/HazardyKnusperkeks requested changes to this pull request.
Do you actually want to use that feature, or do you only want to work on
something?
Please take a greater look on how enums are documented, parsed, and tested. A
fairly recent example which transitioned from `bool` w
@@ -161,7 +171,8 @@ TEST(ConfigParseTest, ParsesConfigurationBools) {
CHECK_PARSE_BOOL(IndentAccessModifiers);
CHECK_PARSE_BOOL(IndentCaseLabels);
CHECK_PARSE_BOOL(IndentCaseBlocks);
- CHECK_PARSE_BOOL(IndentGotoLabels);
+ CHECK_PARSE_ENUM(IndentGotoLabels,
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/65140
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2421,20 +2421,28 @@ struct FormatStyle {
/// Indent goto labels.
///
- /// When ``false``, goto labels are flushed left.
/// \code
- ///true: false:
- ///int f() { vs. int f() {
- /// if (foo
@@ -3311,22 +3311,22 @@ the configuration (without a prefix: ``Auto``).
.. _IndentGotoLabels:
-**IndentGotoLabels** (``Boolean``) :versionbadge:`clang-format 10` :ref:`¶
`
+**IndentGotoLabels** (``enum``) :versionbadge:`clang-format 10` :ref:`¶
`
Indent goto labels.
-
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/65409
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/65429
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks created
https://github.com/llvm/llvm-project/pull/65526:
When we are in an expression, it has to be a binary operator and not pointer of
reference.
From 7373d5822994616d9fba5d939815c9258d6f9a93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A
https://github.com/HazardyKnusperkeks review_requested
https://github.com/llvm/llvm-project/pull/65526
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
Yay
https://github.com/llvm/llvm-project/pull/65540
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks closed
https://github.com/llvm/llvm-project/pull/65526
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Author: Björn Schäpers
Date: 2022-11-21T13:24:17+01:00
New Revision: aff838fb8f1d398e8d9fc6ec15b5a10db3e1c057
URL:
https://github.com/llvm/llvm-project/commit/aff838fb8f1d398e8d9fc6ec15b5a10db3e1c057
DIFF:
https://github.com/llvm/llvm-project/commit/aff838fb8f1d398e8d9fc6ec15b5a10db3e1c057.diff
Author: Björn Schäpers
Date: 2022-11-21T13:24:18+01:00
New Revision: c89d2fd596cec8cf3a8100c504f045b9727fa98a
URL:
https://github.com/llvm/llvm-project/commit/c89d2fd596cec8cf3a8100c504f045b9727fa98a
DIFF:
https://github.com/llvm/llvm-project/commit/c89d2fd596cec8cf3a8100c504f045b9727fa98a.diff
Author: Björn Schäpers
Date: 2022-11-21T13:24:18+01:00
New Revision: 9e00909b00f9e75b4f710bc60f13ceea1215746c
URL:
https://github.com/llvm/llvm-project/commit/9e00909b00f9e75b4f710bc60f13ceea1215746c
DIFF:
https://github.com/llvm/llvm-project/commit/9e00909b00f9e75b4f710bc60f13ceea1215746c.diff
Author: Björn Schäpers
Date: 2022-11-21T13:24:19+01:00
New Revision: 5ba5f7c46ccfe98fd68d6e31d25f386d67d484b4
URL:
https://github.com/llvm/llvm-project/commit/5ba5f7c46ccfe98fd68d6e31d25f386d67d484b4
DIFF:
https://github.com/llvm/llvm-project/commit/5ba5f7c46ccfe98fd68d6e31d25f386d67d484b4.diff
@@ -55,5 +59,271 @@ TEST_F(FormatTestTableGen, NoSpacesInSquareBracketLists) {
verifyFormat("def flag : Flag<[\"-\", \"--\"], \"foo\">;");
}
+TEST_F(FormatTestTableGen, LiteralsAndIdentifiers) {
+ verifyFormat("def LiteralAndIdentifiers {\n"
+ " let someInteg
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/81611
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks commented:
Could you please add a note to `clang/docs/ReleaseNotes.rst`.
https://github.com/llvm/llvm-project/pull/95013
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailma
https://github.com/HazardyKnusperkeks 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
https://github.com/HazardyKnusperkeks approved this pull request.
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/HazardyKnusperkeks approved this pull request.
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/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/107352
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/107312
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks commented:
You are touching a lot of projects. I don't know how others feel about that,
but my preference would be to tackle one project per PR.
https://github.com/llvm/llvm-project/pull/107312
___
cfe-commits mai
@@ -109,6 +110,9 @@ class ChangeNamespaceTool : public
ast_matchers::MatchFinder::MatchCallback {
};
std::string FallbackStyle;
+ // Specifies the list of paths to be searched when FormatStyle or a
BasedOnStyle
+ // in a .clang-format file specifies an arbitrary file t
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/107675
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -25831,19 +25843,108 @@ TEST_F(FormatTest, RequiresClausesPositions) {
verifyFormat("template \n"
"int S::bar(T t) &&\n"
- "requires F {\n"
+ "requires F\n"
+ "{\n"
" return 5;\n"
"}
@@ -25831,19 +25843,108 @@ TEST_F(FormatTest, RequiresClausesPositions) {
verifyFormat("template \n"
"int S::bar(T t) &&\n"
- "requires F {\n"
+ "requires F\n"
+ "{\n"
" return 5;\n"
"}
@@ -5682,12 +5683,15 @@ bool TokenAnnotator::mustBreakBefore(const
AnnotatedLine &Line,
(Style.BreakTemplateDeclarations == FormatStyle::BTDS_Leave &&
Right.NewlinesBefore > 0);
}
- if (Left.ClosesRequiresClause && Right.isNot(tok::semi) &&
- Rig
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/102629
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
Nah, I can't find a better name, which isn't a whole sentence.
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/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/102078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/102894
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -47,8 +47,7 @@ void printLine(llvm::raw_ostream &OS, const UnwrappedLine
&Line,
OS << Prefix;
NewLine = false;
}
-OS << I->Tok->Tok.getName() << "["
- << "T=" << (unsigned)I->Tok->getType()
+OS << I->Tok->Tok.getName() << "[" << "T=" << (unsign
@@ -346,6 +345,35 @@ bool UnwrappedLineParser::precededByCommentOrPPDirective()
const {
(Previous->IsMultiline || Previous->NewlinesBefore > 0);
}
+void UnwrappedLineParser::parseStmt(bool keepIndentation) {
+ bool levelsAreAdded = (Line->Level == DeclarationScopeSt
https://github.com/HazardyKnusperkeks requested changes to this pull request.
First of all you need a better title for your change, beginning with
"[clang-format]"
Second of all, could you please split this in multiple reviews?
Third of all, you need to add tests.
https://github.com/llvm/llvm
@@ -465,6 +493,9 @@ bool UnwrappedLineParser::parseLevel(const FormatToken
*OpeningBrace,
SwitchLabelEncountered = true;
parseStructuralElement();
break;
+case tok::kw_using:
+ parseStmt(Style.IndentUsingDeclarations);
HazardyKnusper
@@ -5104,6 +5144,9 @@ struct FormatStyle {
IndentCaseBlocks == R.IndentCaseBlocks &&
IndentCaseLabels == R.IndentCaseLabels &&
IndentExternBlock == R.IndentExternBlock &&
+ IndentNamespaceAliases == R.IndentNamespaceAliases &&
+
@@ -2822,6 +2822,46 @@ struct FormatStyle {
/// \version 11
IndentExternBlockStyle IndentExternBlock;
+ /// IndentNamespaceAliases is the type of indenting of namespace aliases
+ /// irrespective of NamespaceIndentation.
+ bool IndentNamespaceAliases;
H
@@ -346,6 +345,35 @@ bool UnwrappedLineParser::precededByCommentOrPPDirective()
const {
(Previous->IsMultiline || Previous->NewlinesBefore > 0);
}
+void UnwrappedLineParser::parseStmt(bool keepIndentation) {
+ bool levelsAreAdded = (Line->Level == DeclarationScopeSt
@@ -2822,6 +2822,46 @@ struct FormatStyle {
/// \version 11
IndentExternBlockStyle IndentExternBlock;
+ /// IndentNamespaceAliases is the type of indenting of namespace aliases
+ /// irrespective of NamespaceIndentation.
+ bool IndentNamespaceAliases;
+
+ /// IndentUsi
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/102921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/87868
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/87924
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/87953
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/88238
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/88355
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/88414
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks closed
https://github.com/llvm/llvm-project/pull/88355
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5598,10 +5598,34 @@ bool TokenAnnotator::mustBreakBefore(const
AnnotatedLine &Line,
// FIXME: Breaking after newlines seems useful in general. Turn this into an
// option and recognize more cases like endl etc, and break independent of
// what comes after operator le
@@ -2193,6 +2193,41 @@ struct FormatStyle {
/// \version 3.7
bool BreakBeforeTernaryOperators;
+ /// Different ways to Break Between Chevrons.
+ enum BreakChevronOperatorStyle : int8_t {
+/// Break using ColumnLimit rules.
+/// \code
+/// os << "a" << "
@@ -5598,10 +5598,34 @@ bool TokenAnnotator::mustBreakBefore(const
AnnotatedLine &Line,
// FIXME: Breaking after newlines seems useful in general. Turn this into an
// option and recognize more cases like endl etc, and break independent of
// what comes after operator le
@@ -2193,6 +2193,41 @@ struct FormatStyle {
/// \version 3.7
bool BreakBeforeTernaryOperators;
+ /// Different ways to Break Between Chevrons.
+ enum BreakChevronOperatorStyle : int8_t {
+/// Break using ColumnLimit rules.
+/// \code
+/// os << "a" << "
@@ -2193,6 +2193,41 @@ struct FormatStyle {
/// \version 3.7
bool BreakBeforeTernaryOperators;
+ /// Different ways to Break Between Chevrons.
+ enum BreakChevronOperatorStyle : int8_t {
+/// Break using ColumnLimit rules.
+/// \code
+/// os << "a" << "
@@ -5598,10 +5598,34 @@ bool TokenAnnotator::mustBreakBefore(const
AnnotatedLine &Line,
// FIXME: Breaking after newlines seems useful in general. Turn this into an
// option and recognize more cases like endl etc, and break independent of
// what comes after operator le
@@ -5598,10 +5598,34 @@ bool TokenAnnotator::mustBreakBefore(const
AnnotatedLine &Line,
// FIXME: Breaking after newlines seems useful in general. Turn this into an
// option and recognize more cases like endl etc, and break independent of
// what comes after operator le
@@ -2193,6 +2193,41 @@ struct FormatStyle {
/// \version 3.7
bool BreakBeforeTernaryOperators;
+ /// Different ways to Break Between Chevrons.
+ enum BreakChevronOperatorStyle : int8_t {
+/// Break using ColumnLimit rules.
+/// \code
+/// os << "a" << "
@@ -5598,11 +5598,45 @@ bool TokenAnnotator::mustBreakBefore(const
AnnotatedLine &Line,
// FIXME: Breaking after newlines seems useful in general. Turn this into an
// option and recognize more cases like endl etc, and break independent of
// what comes after operator le
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/94425
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks approved this pull request.
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
@@ -1457,6 +1457,11 @@ unsigned ContinuationIndenter::getNewLineColumn(const
LineState &State) {
!Current.isOneOf(tok::colon, tok::comment)) {
return ContinuationIndent;
}
+ if (Style.isCpp() && Current.is(tok::arrow) &&
HazardyKnusperkeks wrote:
@@ -22858,6 +22858,31 @@ TEST_F(FormatTest, FormatsLambdas) {
" //\n"
"});");
+ verifyFormat("int main() {\n"
HazardyKnusperkeks wrote:
Get yourself a style with a lower column limit `auto Style =
getLLVMStyleWithColumnLimit(40);` and u
https://github.com/HazardyKnusperkeks approved this pull request.
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
@@ -187,7 +187,6 @@ TEST(ConfigParseTest, ParsesConfigurationBools) {
CHECK_PARSE_BOOL(RemoveSemicolon);
CHECK_PARSE_BOOL(SkipMacroDefinitionBody);
CHECK_PARSE_BOOL(SpacesInSquareBrackets);
- CHECK_PARSE_BOOL(SpaceInEmptyBlock);
HazardyKnusperkeks wrote:
@@ -22858,6 +22858,31 @@ TEST_F(FormatTest, FormatsLambdas) {
" //\n"
"});");
+ verifyFormat("int main() {\n"
HazardyKnusperkeks wrote:
Cache the style and re use it.
https://github.com/llvm/llvm-project/pull/94560
_
@@ -1457,7 +1457,7 @@ unsigned ContinuationIndenter::getNewLineColumn(const
LineState &State) {
!Current.isOneOf(tok::colon, tok::comment)) {
return ContinuationIndent;
}
- if (Style.isCpp() && Current.is(tok::arrow) &&
+ if (Style.isCpp() && Current.is(TT_Traili
@@ -796,6 +796,24 @@ TEST_F(FormatTestComments,
ParsesCommentsAdjacentToPPDirectives) {
format("namespace {}\n /* Test */#define A"));
}
+
+TEST_F(FormatTestComments, DeIdentsCommentBeforeIfdefAfterBracelessIf) {
+ EXPECT_EQ("void f() {\n"
@@ -4736,6 +4738,7 @@ void UnwrappedLineParser::distributeComments(
// the two lines about b form a maximal trail, so there are two sections, the
// first one consisting of the single comment "// line about a" and the
// second one consisting of the next two comments.
+
-
@@ -4828,7 +4834,11 @@ void UnwrappedLineParser::readToken(int LevelDifference)
{
PPBranchLevel > 0) {
Line->Level += PPBranchLevel;
}
- flushComments(isOnNewLine(*FormatTok));
+
+ if (!UnBracedBodyDepth) {
HazardyKnusperkeks
@@ -338,6 +338,9 @@ class UnwrappedLineParser {
// `decltype(auto)`.
bool IsDecltypeAutoFunction = false;
+
+ int UnBracedBodyDepth = 0;
HazardyKnusperkeks wrote:
Could you add some documentation?
https://github.com/llvm/llvm-project/pull/94776
https://github.com/HazardyKnusperkeks 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
@@ -208,6 +208,9 @@ RawStringFormatStyleManager::RawStringFormatStyleManager(
LanguageStyle = PredefinedStyle;
}
LanguageStyle->ColumnLimit = CodeStyle.ColumnLimit;
+// This way the first line of the string does not have to follow the code
+// before the s
@@ -1203,6 +1214,10 @@ unsigned
ContinuationIndenter::addTokenOnNewLine(LineState &State,
}
}
+ if (!Style.BinPackBinaryOperations && Previous.is(TT_BinaryOperator) &&
HazardyKnusperkeks wrote:
Couldn't you just call `startsNextOperand`?
https://gith
@@ -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
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BinPackBinaryOperations) {
+ auto Style = getLLVMStyle();
+ Style.BinPackBinaryOperations = false;
+
+ // Logical operations
+ verifyF
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BinPackBinaryOperations) {
+ auto Style = getLLVMStyle();
+ Style.BinPackBinaryOperations = false;
+
+ // Logical operations
+ verifyF
@@ -27492,6 +27492,86 @@ TEST_F(FormatTest, SpaceBetweenKeywordAndLiteral) {
verifyFormat("return sizeof \"5\";");
}
+TEST_F(FormatTest, BinPackBinaryOperations) {
+ auto Style = getLLVMStyle();
+ Style.BinPackBinaryOperations = false;
+
+ // Logical operations
+ verifyF
https://github.com/HazardyKnusperkeks edited
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
501 - 600 of 884 matches
Mail list logo