HazardyKnusperkeks wrote:
> I suggest `NumericLiteralCase`, `Prefix`, `HexDigit`, `ExponentLetter`, and
> `Suffix` for the option names and `Leave`, `Lower`, and `Upper` for the enum
> values. For example:
>
> ```
> NumericLiteralCase:
> Prefix: Lower # 0x, 0b, etc.
> HexDigit:
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -5438,6 +5508,7 @@ struct FormatStyle {
MaxEmptyLinesToKeep == R.MaxEmptyLinesToKeep &&
NamespaceIndentation == R.NamespaceIndentation &&
NamespaceMacros == R.NamespaceMacros &&
+ NumericLiteralCase == R.NumericLiteralCase &&
--
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -3558,6 +3558,76 @@ struct FormatStyle {
/// \version 9
std::vector NamespaceMacros;
+ /// Control over each component in a numeric literal.
+ enum NumericLiteralComponentStyle : int8_t {
+/// Leave this component of the literal as is.
+NLCS_Leave,
+/// Al
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -5438,6 +5508,7 @@ struct FormatStyle {
MaxEmptyLinesToKeep == R.MaxEmptyLinesToKeep &&
NamespaceIndentation == R.NamespaceIndentation &&
NamespaceMacros == R.NamespaceMacros &&
+ NumericLiteralCase == R.NumericLiteralCase &&
--
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -0,0 +1,347 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/151590
___
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'm not finished reviewing the changes, but must leave now. ;)
https://github.com/llvm/llvm-project/pull/151590
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mail
@@ -3558,6 +3558,76 @@ struct FormatStyle {
/// \version 9
std::vector NamespaceMacros;
+ /// Control over each component in a numeric literal.
+ enum NumericLiteralComponentStyle : int8_t {
+/// Leave this component of the literal as is.
+NLCS_Leave,
+/// Al
@@ -0,0 +1,368 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/151658
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
> Looking at the
> [CI](https://github.com/llvm/llvm-project/actions/runs/16659524063/job/47155439985?pr=151590#step:3:28856)
> it seems the `clang/test/Format/docs_updated.test` test failed. This may be
> due to incorrect formatting of your style option in
> `ClangF
@@ -0,0 +1,368 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -0,0 +1,368 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -0,0 +1,368 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -0,0 +1,368 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -1618,6 +1630,9 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Language) {
LLVMStyle.InsertBraces = false;
LLVMStyle.InsertNewlineAtEOF = false;
LLVMStyle.InsertTrailingCommas = FormatStyle::TCS_None;
+ LLVMStyle.NumericLiteralCase = {/*PrefixCase=*/0, /*HexDi
@@ -3100,6 +3100,54 @@ struct FormatStyle {
/// \version 11
TrailingCommaStyle InsertTrailingCommas;
+ /// Character case format for different components of a numeric literal.
+ ///
+ /// For all options, ``0`` leave the case unchanged, ``-1``
+ /// uses lower case and
@@ -1093,6 +1104,7 @@ template <> struct MappingTraits {
IO.mapOptional("InsertBraces", Style.InsertBraces);
IO.mapOptional("InsertNewlineAtEOF", Style.InsertNewlineAtEOF);
IO.mapOptional("InsertTrailingCommas", Style.InsertTrailingCommas);
+IO.mapOptional("Nume
@@ -0,0 +1,368 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
https://github.com/HazardyKnusperkeks commented:
A bit to do, but I like the proposed feature.
https://github.com/llvm/llvm-project/pull/151590
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-
@@ -5424,6 +5472,7 @@ struct FormatStyle {
IndentWrappedFunctionNames == R.IndentWrappedFunctionNames &&
InsertBraces == R.InsertBraces &&
InsertNewlineAtEOF == R.InsertNewlineAtEOF &&
+ NumericLiteralCase == R.NumericLiteralCase &&
--
@@ -382,6 +383,16 @@ struct
ScalarEnumerationTraits {
}
};
+template <> struct MappingTraits {
HazardyKnusperkeks wrote:
Sort
https://github.com/llvm/llvm-project/pull/151590
___
cfe-commits mailing list
cfe-com
@@ -3100,6 +3100,54 @@ struct FormatStyle {
/// \version 11
TrailingCommaStyle InsertTrailingCommas;
+ /// Character case format for different components of a numeric literal.
+ ///
+ /// For all options, ``0`` leave the case unchanged, ``-1``
+ /// uses lower case and
@@ -0,0 +1,368 @@
+//===--- NumericLiteralCaseFixer.cpp ---*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2
@@ -3872,6 +3887,10 @@ reformat(const FormatStyle &Style, StringRef Code,
return IntegerLiteralSeparatorFixer().process(Env, Expanded);
});
+ Passes.emplace_back([&](const Environment &Env) {
HazardyKnusperkeks wrote:
Add a check, if any option is not
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/151590
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -532,6 +538,20 @@ class LineJoiner {
}
return MergedLines;
}
+
+// Previously, UnwrappedLineParser would move the left brace to a new line
+// when AllowShortFunctionBodiesOnASingleLine is enabled. However, if the
+// function body cannot fit on a
@@ -878,6 +878,12 @@ struct FormatStyle {
/// \version 3.5
ShortFunctionStyle AllowShortFunctionsOnASingleLine;
+ /// Dependent on the value, function body like ``{ return 0; }`` can be
+ /// put on a single line. Only when AllowShortFunctionsOnASingleLine = None
+ ///
@@ -1921,6 +1921,10 @@ void UnwrappedLineParser::parseStructuralElement(
}
} else if (Style.BraceWrapping.AfterFunction) {
addUnwrappedLine();
+} else if (Style.AllowShortFunctionBodiesOnASingleLine) {
+ // Wrap the left brace here;
@@ -532,6 +538,20 @@ class LineJoiner {
}
return MergedLines;
}
+
+// Previously, UnwrappedLineParser would move the left brace to a new line
HazardyKnusperkeks wrote:
Something like `Previously` is suitable for a commit message, not for th
@@ -878,6 +878,12 @@ struct FormatStyle {
/// \version 3.5
ShortFunctionStyle AllowShortFunctionsOnASingleLine;
+ /// Dependent on the value, function body like ``{ return 0; }`` can be
+ /// put on a single line. Only when AllowShortFunctionsOnASingleLine = None
+ ///
https://github.com/HazardyKnusperkeks edited
https://github.com/llvm/llvm-project/pull/151428
___
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 missing unit tests. `clang/unittests/Format/FromatTest.cpp`.
https://github.com/llvm/llvm-project/pull/151428
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bi
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/150744
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2639,32 +2639,42 @@ class Formatter : public TokenAnalyzer {
int countVariableAlignments(const SmallVectorImpl &Lines) {
int AlignmentDiff = 0;
+
for (const AnnotatedLine *Line : Lines) {
AlignmentDiff += countVariableAlignments(Line->Children);
- fo
@@ -2639,32 +2639,42 @@ class Formatter : public TokenAnalyzer {
int countVariableAlignments(const SmallVectorImpl &Lines) {
int AlignmentDiff = 0;
+
for (const AnnotatedLine *Line : Lines) {
AlignmentDiff += countVariableAlignments(Line->Children);
- fo
@@ -2639,32 +2639,42 @@ class Formatter : public TokenAnalyzer {
int countVariableAlignments(const SmallVectorImpl &Lines) {
int AlignmentDiff = 0;
+
for (const AnnotatedLine *Line : Lines) {
AlignmentDiff += countVariableAlignments(Line->Children);
- fo
@@ -2641,28 +2641,19 @@ class Formatter : public TokenAnalyzer {
int AlignmentDiff = 0;
for (const AnnotatedLine *Line : Lines) {
AlignmentDiff += countVariableAlignments(Line->Children);
- for (FormatToken *Tok = Line->First; Tok && Tok->Next; Tok = Tok->Nex
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/150744
___
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/150658
___
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/150658
___
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/150387
___
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/150367
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -17762,14 +17762,19 @@ TEST_F(FormatTest, ConfigurableSpaceBeforeParens) {
}
TEST_F(FormatTest, SpaceAfterLogicalNot) {
- FormatStyle Spaces = getLLVMStyle();
- Spaces.SpaceAfterLogicalNot = true;
+ auto Spaces = getLLVMStyle();
+ EXPECT_EQ(Spaces.SpaceAfterLogicalNot,
@@ -4483,13 +4483,32 @@ struct FormatStyle {
/// \version 3.5
bool SpaceAfterCStyleCast;
- /// If ``true``, a space is inserted after the logical not operator (``!``).
- /// \code
- ///true: false:
- ///! someExpression();
@@ -4483,13 +4483,32 @@ struct FormatStyle {
/// \version 3.5
bool SpaceAfterCStyleCast;
- /// If ``true``, a space is inserted after the logical not operator (``!``).
- /// \code
- ///true: false:
- ///! someExpression();
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/149765
___
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/149695
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3630,6 +3630,36 @@ static unsigned maxNestingDepth(const AnnotatedLine
&Line) {
return Result;
}
+// Returns the token after the first qualifier of the name, or nullptr if there
+// is no qualifier.
+static FormatToken* skipNameQualifier(const FormatToken *Tok) {
--
@@ -3122,6 +3122,9 @@ class AnnotatingParser {
}
}
+if (PrevToken->isTypeName(LangOpts))
HazardyKnusperkeks wrote:
Thanks.
https://github.com/llvm/llvm-project/pull/149039
___
cfe-commits mailing list
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/149039
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3122,6 +3122,9 @@ class AnnotatingParser {
}
}
+if (PrevToken->isTypeName(LangOpts))
HazardyKnusperkeks wrote:
So this does not work with `bool foo = requires { static_cast(1);
};`?
https://github.com/llvm/llvm-project/pull/149039
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/137840
___
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/148640
___
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/148324
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -927,14 +927,12 @@ BreakableLineCommentSection::BreakableLineCommentSection(
}
if (Lines[i].size() != IndentPrefix.size()) {
-PrefixSpaceChange[i] = FirstLineSpaceChange;
+assert(Lines[i].size() > IndentPrefix.size());
-if (SpacesInPref
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/148345
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2786,6 +2786,11 @@ struct FormatStyle {
/// \version 3.7
std::vector ForEachMacros;
+ /// A vector of function-like macros whose invocations should be skipped by
+ /// ``RemoveParentheses``.
+ /// \version 21
+ std::vector FunctionLikeMacros;
Hazar
@@ -927,14 +927,12 @@ BreakableLineCommentSection::BreakableLineCommentSection(
}
if (Lines[i].size() != IndentPrefix.size()) {
-PrefixSpaceChange[i] = FirstLineSpaceChange;
+assert(Lines[i].size() > IndentPrefix.size());
-if (SpacesInPref
@@ -927,14 +927,12 @@ BreakableLineCommentSection::BreakableLineCommentSection(
}
if (Lines[i].size() != IndentPrefix.size()) {
-PrefixSpaceChange[i] = FirstLineSpaceChange;
+assert(Lines[i].size() > IndentPrefix.size());
-if (SpacesInPref
@@ -2786,6 +2786,11 @@ struct FormatStyle {
/// \version 3.7
std::vector ForEachMacros;
+ /// A vector of function-like macros whose invocations should be skipped by
+ /// ``RemoveParentheses``.
+ /// \version 21
+ std::vector FunctionLikeMacros;
Hazar
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/146245
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
> Had we used `StringRef::contains` initially, would you still insist that it
> be replaced with a "more performant" local function?
Of course not, because no one would go look for it.
https://github.com/llvm/llvm-project/pull/146245
_
HazardyKnusperkeks wrote:
> > I added code to count the number of characters in the escape sequence
> > probably just because the block of code used to have a comment saying
> > someone should add the feature.
>
> > I am not sure we should support the trigraph. I don't know anyone who uses
>
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/147164
___
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.
Please wait a few days, or until another approval.
https://github.com/llvm/llvm-project/pull/146761
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin
HazardyKnusperkeks wrote:
> > While it is less code, I find a bit harder to understand and the code gen
> > is far worse: https://gcc.godbolt.org/z/KzG4YnTh3
>
> `IsBlank` is misleading because of `std::isblank` whereas `Blanks.contains`
> is not, so the latter has better readability for me. A
https://github.com/HazardyKnusperkeks commented:
While it is less code, I find a bit harder to understand and the code gen is
far worse: https://gcc.godbolt.org/z/KzG4YnTh3
https://github.com/llvm/llvm-project/pull/146245
___
cfe-commits mailing list
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/146256
___
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/146202
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Language) {
LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave;
LLVMStyle.ShortNamespaceLines = 1;
LLVMStyle.SkipMacroDefinitionBody = false;
- LLVMStyle.SortIncludes = {/*Enabled=*/true,
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/145853
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1647,7 +1647,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind
Language) {
LLVMStyle.SeparateDefinitionBlocks = FormatStyle::SDS_Leave;
LLVMStyle.ShortNamespaceLines = 1;
LLVMStyle.SkipMacroDefinitionBody = false;
- LLVMStyle.SortIncludes = {/*Enabled=*/true,
@@ -4382,8 +4382,18 @@ struct FormatStyle {
///#include "B/a.h" #include "a/b.h"
/// \endcode
bool IgnoreCase;
+/// When sorting includes in each block, Only take file extensions into
HazardyKnusperkeks wrote:
```suggestion
//
https://github.com/HazardyKnusperkeks closed
https://github.com/llvm/llvm-project/pull/145243
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1295,13 +1305,18 @@ FormatToken *FormatTokenLexer::getNextToken() {
case '/':
// The text was entirely whitespace when this loop was entered. Thus
// this has to be an escape sequence.
-assert(Text.substr(i, 2) == "\\\r" || Text.substr(i, 2) ==
@@ -1295,13 +1305,18 @@ FormatToken *FormatTokenLexer::getNextToken() {
case '/':
// The text was entirely whitespace when this loop was entered. Thus
// this has to be an escape sequence.
-assert(Text.substr(i, 2) == "\\\r" || Text.substr(i, 2) ==
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/145686
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
I don't actually understand your problem. Can you open an issue and give the
input, the output and the expected output, along with your `.clang-format`? You
can tag me and I'll have a look at it.
https://github.com/llvm/llvm-project/pull/86150
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/145468
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1295,13 +1305,18 @@ FormatToken *FormatTokenLexer::getNextToken() {
case '/':
// The text was entirely whitespace when this loop was entered. Thus
// this has to be an escape sequence.
-assert(Text.substr(i, 2) == "\\\r" || Text.substr(i, 2) ==
https://github.com/HazardyKnusperkeks approved this pull request.
Please wait for @owenca .
https://github.com/llvm/llvm-project/pull/145243
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com
@@ -0,0 +1,14 @@
+// RUN: grep -Ev "// *[A-Z-]+:" %s \
HazardyKnusperkeks wrote:
We test those things in the unit tests.
https://github.com/llvm/llvm-project/pull/145243
___
cfe-commits mailing list
cfe-commits@lists.l
@@ -0,0 +1,14 @@
+// RUN: grep -Ev "// *[A-Z-]+:" %s \
HazardyKnusperkeks wrote:
That's not what I meant. We test in `clang/unittests/Format/FormatTest.cpp`.
https://github.com/llvm/llvm-project/pull/145243
___
cfe-com
https://github.com/HazardyKnusperkeks closed
https://github.com/llvm/llvm-project/pull/145145
___
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/145145
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
HazardyKnusperkeks wrote:
> > You can't change existing tests, you need an option if you want to pad with
> > spaces
>
> It is unclear to me if this should be considered a bug fix, or a new feature.
> Surely requiring new options are not required for every bug fix.
>
It boils down to the que
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/144255
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -706,42 +706,48 @@ void
ContinuationIndenter::addTokenOnCurrentLine(LineState &State, bool DryRun,
const FormatToken &Previous = *State.NextToken->Previous;
auto &CurrentState = State.Stack.back();
- bool DisallowLineBreaksOnThisLine =
- Style.LambdaBodyIndentati
https://github.com/HazardyKnusperkeks approved this pull request.
https://github.com/llvm/llvm-project/pull/144095
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -3651,6 +3674,21 @@ static FormatToken *getFunctionName(const AnnotatedLine
&Line,
continue;
}
+// Skip past template typename declarations that may precede the
+// constructor/destructor name
+if (Tok->is(tok::kw_template)) {
Hazardy
1 - 100 of 1095 matches
Mail list logo