https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/121139
___
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/118046
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -11077,6 +11077,221 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateClose) {
HazardyKnusperkeks wrote:
Sorry missed that, didn't look for the lambda case.
https://github.com/llvm/llvm-
@@ -11077,6 +11077,281 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateClose) {
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
+ Style.ColumnLimit = 0;
+ verifyNoChange("template \n"
+
@@ -2831,8 +2842,21 @@ class AnnotatingParser {
IsQualifiedPointerOrReference(BeforeRParen, LangOpts);
bool ParensCouldEndDecl =
AfterRParen->isOneOf(tok::equal, tok::semi, tok::l_brace,
tok::greater);
-if (ParensAreType && !ParensCouldEndDecl)
+if
@@ -38,6 +40,10 @@ static bool mustBreakAfterAttributes(const FormatToken &Tok,
namespace {
+// TODO: Add new Type modifiers
HazardyKnusperkeks wrote:
```suggestion
// TODO: Add new Type modifiers.
```
https://github.com/llvm/llvm-project/pull/120904
__
@@ -11077,6 +11077,221 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateClose) {
HazardyKnusperkeks wrote:
This one is still missing.
https://github.com/llvm/llvm-project/pull/118046
_
HazardyKnusperkeks wrote:
> > > I struggle with changes that encourage people to not be fully
> > > clang-formatted, I would prefer to ask why we need this feature, can we
> > > have some examples of where this would be used?
> >
> >
> > This makes it so only one line isn't formatted instead
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/112482
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
> > I think it should be merges with `BinPackArguments` to get an enum
> >
> > * Never
> > * TwentyOrAbove (name is debatable)
> > * Always
> > * (Leave?)
>
> Currently the 20 item limit is only enforced on C++ initializer lists. Making
> it part of the `BinPackArgume
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Language) {
FormatStyle LLVMStyle;
LLVMStyle.AccessModifierOffset = -2;
LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align;
+ LLVMStyle.AlignAfterOpenBracketBreak = {};
Hazar
@@ -233,6 +233,10 @@ MacroExpander::expand(FormatToken *ID,
if (Result.size() > 1) {
++Result[0]->MacroCtx->StartOfExpansion;
++Result[Result.size() - 2]->MacroCtx->EndOfExpansion;
+ } else {
+// If the macro expansion is empty, mark the start and end
---
@@ -11077,6 +11077,221 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateClose) {
+ FormatStyle Style = getGoogleStyle(FormatStyle::LK_Cpp);
+ Style.ColumnLimit = 0;
+ verifyNoChange("template \n"
+
@@ -11077,6 +11077,221 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateClose) {
HazardyKnusperkeks wrote:
One additional test: How about nested templates?
`template typename T>` for exampl
@@ -144,7 +144,8 @@ void DefinitionBlockSeparator::separateBlocks(
return false;
if (const auto *Tok = OperateLine->First;
- Tok->is(tok::comment) && !isClangFormatOn(Tok->TokenText)) {
+ Tok->is(tok::comment) && parseClangFormatDirective(Tok->T
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/118409
___
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/112482
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks commented:
I think it should be merges with `BinPackArguments` to get an enum
* Never
* TwentyOrAbove (name is debatable)
* Always
* (Leave?)
https://github.com/llvm/llvm-project/pull/112482
___
cfe-commits mailing
@@ -1208,6 +1208,21 @@ struct FormatStyle {
/// \version 3.7
bool BinPackArguments;
+ /// If ``BinPackArguments`` is ``false`` this option can override it if
+ /// ``true`` when 20 or more items are in a braced initializer list.
HazardyKnusperkeks wrote:
@@ -811,10 +816,11 @@ void
ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
if (!Tok.Previous)
return true;
if (Tok.Previous->isIf())
- return Style.AlignAfterOpenBracket == FormatStyle::BAS_AlwaysBreak;
-return !Tok.Previous->i
@@ -1169,6 +1181,18 @@ template <> struct MappingTraits {
IO.mapOptional("WhitespaceSensitiveMacros",
Style.WhitespaceSensitiveMacros);
+// If AlignAfterOpenBracket was specified but AlignAfterOpenBracketBreak
+// was not, initialize the latter f
@@ -1169,6 +1181,18 @@ template <> struct MappingTraits {
IO.mapOptional("WhitespaceSensitiveMacros",
Style.WhitespaceSensitiveMacros);
+// If AlignAfterOpenBracket was specified but AlignAfterOpenBracketBreak
+// was not, initialize the latter f
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks commented:
I don't think this is the way to go, or at least not with this name.
How about going the `Custom` way?
https://github.com/llvm/llvm-project/pull/108332
___
cfe-commits mailing list
cfe-commits@lists.llv
@@ -1452,6 +1476,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Language) {
FormatStyle LLVMStyle;
LLVMStyle.AccessModifierOffset = -2;
LLVMStyle.AlignAfterOpenBracket = FormatStyle::BAS_Align;
+ LLVMStyle.AlignAfterOpenBracketBreak = {};
Hazar
@@ -3398,6 +3401,21 @@ struct FormatStyle {
/// \version 3.7
unsigned MaxEmptyLinesToKeep;
+ /// If ``BinPackArguments`` is ``false`` this option can override it if
+ /// ``true`` when 20 or more items are in a braced initializer list.
+ /// \code
+ ///BinPackLongB
@@ -11077,6 +11077,157 @@ TEST_F(FormatTest,
WrapsTemplateDeclarationsWithComments) {
Style);
}
+TEST_F(FormatTest, BreakBeforeTemplateClose) {
HazardyKnusperkeks wrote:
I want to see some lambdas and template usages (not declarations).
https://github
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/117472
___
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/116000
___
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/114639
___
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/114506
___
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/114078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1296,6 +1296,15 @@ TEST_F(TokenAnnotatorTest,
UnderstandsRequiresClausesAndConcepts) {
Tokens = annotate("bool x = t && requires(Foo x) { x.foo(); };");
ASSERT_EQ(Tokens.size(), 25u) << Tokens;
EXPECT_TOKEN(Tokens[5], tok::kw_requires, TT_RequiresExpression);
+
+ //
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/113640
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -26588,10 +26613,7 @@ TEST_F(FormatTest, Cpp20ModulesSupport) {
" int foo;\n"
"};",
Style);
- verifyFormat("export {\n"
- " int foo;\n"
- "};",
- Style);
+ verifyFormat("export { int f
@@ -49,11 +49,29 @@ bool matchFilePath(StringRef Pattern, StringRef FilePath) {
return false;
break;
case '*': {
- while (++I < EOP && Pattern[I] == '*') { // Skip consecutive stars.
+ if (I + 1 < EOP && Pattern[I + 1] == '*') {
+// Handle '*
@@ -3107,29 +3131,15 @@ void UnwrappedLineParser::parseNamespace() {
DeclarationScopeStack.size() > 1)
? 1u
: 0u;
-bool ManageWhitesmithsBraces =
-AddLevels == 0u &&
-Style.BreakBeforeBraces == FormatStyle::BS_Whitesm
@@ -49,11 +49,29 @@ bool matchFilePath(StringRef Pattern, StringRef FilePath) {
return false;
break;
case '*': {
- while (++I < EOP && Pattern[I] == '*') { // Skip consecutive stars.
+ if (I + 1 < EOP && Pattern[I + 1] == '*') {
+// Handle '*
@@ -5230,6 +5239,7 @@ struct FormatStyle {
TableGenBreakingDAGArgOperators ==
R.TableGenBreakingDAGArgOperators &&
TableGenBreakInsideDAGArg == R.TableGenBreakInsideDAGArg &&
+ TabWidth == R.TabWidth && TemplateNames == R.TemplateN
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/113268
___
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/113100
___
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/104533
___
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/107675
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -28104,6 +28104,251 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, WrapNamespaceBodyWithEmptyLinesNever) {
+ FormatStyle Style = getLLVMStyle();
+ Style.FixNamespaceComments = false;
+ Style.ShortNamespaceLines = 0;
+ Style.M
@@ -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
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
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 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 approved this pull request.
https://github.com/llvm/llvm-project/pull/107041
___
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/107021
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -28104,6 +28104,211 @@ 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/106662
___
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/106654
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1493,6 +1511,18 @@ static auto computeNewlines(const AnnotatedLine &Line,
Newlines = 1;
}
+ // Insert empty line after "{" that opens namespace scope
+ if (Style.WrapNamespaceBodyWithNewlines &&
+ LineStartsNamespaceScope(&Line, PreviousLine, PrevPrevLine)) {
@@ -5057,6 +5057,21 @@ struct FormatStyle {
/// \version 11
std::vector WhitespaceSensitiveMacros;
+ /// Insert a newline at the begging and at the end of namespace definition
+ /// \code
+ /// false: vs. true:
+ ///
+ /// namespace
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/105923
___
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/106175
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1493,6 +1511,18 @@ static auto computeNewlines(const AnnotatedLine &Line,
Newlines = 1;
}
+ // Insert empty line after "{" that opens namespace scope
+ if (Style.WrapNamespaceBodyWithNewlines &&
+ LineStartsNamespaceScope(&Line, PreviousLine, PrevPrevLine)) {
@@ -1493,6 +1511,18 @@ static auto computeNewlines(const AnnotatedLine &Line,
Newlines = 1;
}
+ // Insert empty line after "{" that opens namespace scope
HazardyKnusperkeks wrote:
```suggestion
// Insert empty line after "{" that opens namespace scop
@@ -5057,6 +5057,21 @@ struct FormatStyle {
/// \version 11
std::vector WhitespaceSensitiveMacros;
+ /// Insert a newline at the begging and at the end of namespace definition
+ /// \code
+ /// false: vs. true:
+ ///
+ /// namespace
@@ -32,6 +32,24 @@ bool isRecordLBrace(const FormatToken &Tok) {
TT_StructLBrace, TT_UnionLBrace);
}
+bool LineStartsNamespaceScope(const AnnotatedLine* Line,
+ const AnnotatedLine* PreviousLine,
+
@@ -5057,6 +5057,21 @@ struct FormatStyle {
/// \version 11
std::vector WhitespaceSensitiveMacros;
+ /// Insert a newline at the begging and at the end of namespace definition
HazardyKnusperkeks wrote:
```suggestion
/// Insert a newline at the begging
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/106013
___
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/105613
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -916,6 +981,23 @@ class LineJoiner {
return 1 + I[1]->Last->TotalLength + 1 + I[2]->Last->TotalLength <= Limit;
}
+ bool nextNLinesFitInto(SmallVectorImpl::const_iterator I,
+ SmallVectorImpl::const_iterator E,
+ unsign
@@ -27981,6 +27981,118 @@ TEST_F(FormatTest, BreakBinaryOperations) {
Style);
}
+TEST_F(FormatTest, ShortNamespacesOption) {
+ FormatStyle Style = getLLVMStyle();
+ Style.AllowShortNamespacesOnASingleLine = true;
+ Style.FixNamespaceComments = false;
+
+ //
@@ -616,6 +625,62 @@ class LineJoiner {
return 1;
}
+ unsigned tryMergeNamespace(SmallVectorImpl::const_iterator
I,
+ SmallVectorImpl::const_iterator
E,
+ unsigned Limit) {
+if (Limit == 0)
+ return 0;
+
@@ -916,6 +981,23 @@ class LineJoiner {
return 1 + I[1]->Last->TotalLength + 1 + I[2]->Last->TotalLength <= Limit;
}
+ bool nextNLinesFitInto(SmallVectorImpl::const_iterator I,
+ SmallVectorImpl::const_iterator E,
+ unsign
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/105168
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
How does it look like without the new?
https://github.com/llvm/llvm-project/pull/105168
___
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/100978
___
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/104669
___
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/102921
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -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
@@ -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;
H
@@ -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 &&
+
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
@@ -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 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
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
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/102629
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -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
@@ -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"
"}
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/96804
___
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/102261
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/HazardyKnusperkeks requested changes to this pull request.
Github says I have to comment something...
https://github.com/llvm/llvm-project/pull/102078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi
HazardyKnusperkeks wrote:
I see where you are coming from, and am annoyed by trailing requires clauses in
my code as well, because it wraps the brace.
Nevertheless I made this on purpose, `OwnLine` says the clause has its own
line(s), the brace does not belong there.
What I refrained from, whe
@@ -411,7 +393,8 @@ bool ContinuationIndenter::mustBreak(const LineState
&State) {
// sets BreakBeforeParameter to avoid bin packing and this creates a
// completely unnecessary line break after a template type that isn't
// line-wrapped.
-(Prev
@@ -1174,6 +1192,18 @@ template <> struct MappingTraits {
Style.PackConstructorInitializers = FormatStyle::PCIS_CurrentLine;
}
+// If BinPackParameters was specified but PackParameters was not,
initialize
+// the latter from the former for backwards compat
@@ -456,6 +455,21 @@ TEST(ConfigParseTest, ParsesConfiguration) {
"AllowAllConstructorInitializersOnNextLine: false",
PackConstructorInitializers, FormatStyle::PCIS_CurrentLine);
+ Style.PackParameters = FormatStyle::PPS_BinPack;
+ CHECK_PARSE("Pa
@@ -1174,6 +1192,18 @@ template <> struct MappingTraits {
Style.PackConstructorInitializers = FormatStyle::PCIS_CurrentLine;
}
+// If BinPackParameters was specified but PackParameters was not,
initialize
+// the latter from the former for backwards compat
@@ -5458,6 +5458,14 @@ bool TokenAnnotator::mustBreakBefore(const AnnotatedLine
&Line,
return true;
}
+ // Ignores the first parameter as this will be handled separately by
+ // BreakFunctionDefinitionParameters or AlignAfterOpenBracket.
+ if ((FormatStyle::PPS_Break
@@ -1918,11 +1901,12 @@ void
ContinuationIndenter::moveStatePastScopeOpener(LineState &State,
// for backwards compatibility.
bool ObjCBinPackProtocolList =
(Style.ObjCBinPackProtocolList == FormatStyle::BPS_Auto &&
- Style.BinPackParameters) ||
+
@@ -1918,11 +1901,12 @@ void
ContinuationIndenter::moveStatePastScopeOpener(LineState &State,
// for backwards compatibility.
bool ObjCBinPackProtocolList =
(Style.ObjCBinPackProtocolList == FormatStyle::BPS_Auto &&
- Style.BinPackParameters) ||
+
HazardyKnusperkeks wrote:
Okay, I can't revoke my vote and remove me as reviewer. As demonstrated I'm not
qualified to review python changes.
https://github.com/llvm/llvm-project/pull/100978
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http
1 - 100 of 778 matches
Mail list logo