[clang] [clang-format] Add AlignConsecutiveEnums (PR #194154)

via cfe-commits cfe-commits at lists.llvm.org
Sun May 3 17:07:51 PDT 2026


github-actions[bot] wrote:

<!--PREMERGE ADVISOR COMMENT: Linux-->
# :penguin: Linux x64 Test Results

* 87595 tests passed
* 1497 tests skipped
* 4 tests failed

## Failed Tests
(click on a test name to see its output)

### Clang
<details>
<summary>Clang.Format/docs_updated.test</summary>

```
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
"/usr/bin/python3" /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Format/../../docs/tools/dump_format_style.py -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Format/Output/docs_updated.test.tmp.style
# executed command: /usr/bin/python3 /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Format/../../docs/tools/dump_format_style.py -o /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Format/Output/docs_updated.test.tmp.style
# note: command had no output on stdout or stderr
# RUN: at line 2
diff --strip-trailing-cr /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Format/Output/docs_updated.test.tmp.style    /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Format/../../docs/ClangFormatStyleOptions.rst
# executed command: diff --strip-trailing-cr /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Format/Output/docs_updated.test.tmp.style /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Format/../../docs/ClangFormatStyleOptions.rst
# .---command stdout------------
# | *** /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/test/Format/Output/docs_updated.test.tmp.style
# | --- /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/test/Format/../../docs/ClangFormatStyleOptions.rst
# | ***************
# | *** 615,778 ****
# |       AlignConsecutiveDeclarations: AcrossEmptyLines
# |   
# |       AlignConsecutiveDeclarations:
# | -       Enabled: true
# | -       AcrossEmptyLines: true
# | -       AcrossComments: false
# | - 
# | -   * ``bool Enabled`` Whether aligning is enabled.
# | - 
# | -     .. code-block:: c++
# | - 
# | -       #define SHORT_NAME       42
# | -       #define LONGER_NAME      0x007f
# | -       #define EVEN_LONGER_NAME (2)
# | -       #define foo(x)           (x * x)
# | -       #define bar(y, z)        (y + z)
# | - 
# | -       int a            = 1;
# | -       int somelongname = 2;
# | -       double c         = 3;
# | - 
# | -       int aaaa : 1;
# | -       int b    : 12;
# | -       int ccc  : 8;
# | - 
# | -       int         aaaa = 12;
# | -       float       b = 23;
# | -       std::string ccc;
# | - 
# | -   * ``bool AcrossEmptyLines`` Whether to align across empty lines.
# | - 
# | -     .. code-block:: c++
# | - 
# | -       true:
# | -       int a            = 1;
# | -       int somelongname = 2;
# | -       double c         = 3;
# | - 
# | -       int d            = 3;
# | - 
# | -       false:
# | -       int a            = 1;
# | -       int somelongname = 2;
# | -       double c         = 3;
# | - 
# | -       int d = 3;
# | - 
# | -   * ``bool AcrossComments`` Whether to align across comments.
# | - 
# | -     .. code-block:: c++
# | - 
# | -       true:
# | -       int d    = 3;
# | -       /* A comment. */
# | -       double e = 4;
# | - 
# | -       false:
# | -       int d = 3;
# | -       /* A comment. */
# | -       double e = 4;
# | - 
# | -   * ``bool AlignCompound`` Only for ``AlignConsecutiveAssignments``.  Whether compound assignments
# | -     like ``+=`` are aligned along with ``=``.
# | - 
# | -     .. code-block:: c++
# | - 
# | -       true:
# | -       a   &= 2;
# | -       bbb  = 2;
# | - 
# | -       false:
# | -       a &= 2;
# | -       bbb = 2;
# | - 
# | -   * ``bool AlignFunctionDeclarations`` Only for ``AlignConsecutiveDeclarations``. Whether function declarations
# | -     are aligned.
# | - 
# | -     .. code-block:: c++
# | - 
# | -       true:
# | -       unsigned int f1(void);
# | -       void         f2(void);
# | -       size_t       f3(void);
# | - 
# | -       false:
# | -       unsigned int f1(void);
# | -       void f2(void);
# | -       size_t f3(void);
# | - 
# | -   * ``bool AlignFunctionPointers`` Only for ``AlignConsecutiveDeclarations``. Whether function pointers are
# | -     aligned.
# | - 
# | -     .. code-block:: c++
# | - 
# | -       true:
# | -       unsigned i;
# | -       int     &r;
# | -       int     *p;
# | -       int      (*f)();
# | - 
# | -       false:
# | -       unsigned i;
# | -       int     &r;
# | -       int     *p;
# | -       int (*f)();
# | - 
# | -   * ``bool PadOperators`` Only for ``AlignConsecutiveAssignments``.  Whether short assignment
# | -     operators are left-padded to the same length as long ones in order to
# | -     put all assignment operators to the right of the left hand side.
# | - 
# | -     .. code-block:: c++
# | - 
# | -       true:
# | -       a   >>= 2;
# | -       bbb   = 2;
# | - 
# | -       a     = 2;
# | -       bbb >>= 2;
# | - 
# | -       false:
# | -       a >>= 2;
# | -       bbb = 2;
# | - 
# | -       a     = 2;
# | -       bbb >>= 2;
# | - 
# | - 
# | - .. _AlignConsecutiveEnums:
# | - 
# | - **AlignConsecutiveEnums** (``AlignConsecutiveStyle``) :versionbadge:`clang-format 23` :ref:`ΒΆ <AlignConsecutiveEnums>`
# | -   Style of aligning consecutive enum assignments.
# | - 
# | -   ``Consecutive`` will align the enum assignments of consecutive lines.
# | -   This will result in formattings like:
# | - 
# | -   .. code-block:: c++
# | - 
# | -     flag_aaaa = 1,
# | -     flag_b    = 12,
# | -     flag_ccc  = 8,
# | - 
# | -   Nested configuration flags:
# | - 
# | -   Alignment options.
# | - 
# | -   They can also be read as a whole for compatibility. The choices are:
# | - 
# | -   * ``None``
# | -   * ``Consecutive``
# | -   * ``AcrossEmptyLines``
# | -   * ``AcrossComments``
# | -   * ``AcrossEmptyLinesAndComments``
# | - 
# | -   For example, to align across empty lines and not across comments, either
# | -   of these work.
# | - 
# | -   .. code-block:: c++
# | - 
# | -     AlignConsecutiveEnums: AcrossEmptyLines
# | - 
# | -     AlignConsecutiveEnums:
# |         Enabled: true
# |         AcrossEmptyLines: true
# |         AcrossComments: false
# | --- 615,620 ----
# `-----------------------------
# error: command failed with exit status: 1

--

```
</details>

### Clang-Unit
<details>
<summary>Clang-Unit.Format/_/FormatTests/10/79</summary>

```
Script(shard):
--
GTEST_OUTPUT=json:/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests-Clang-Unit-501739-10-79.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=79 GTEST_SHARD_INDEX=10 /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests
--

Note: This is test shard 11 of 79.
[==========] Running 16 tests from 11 test suites.
[----------] Global test environment set-up.
[----------] 1 test from AlignmentTest
[ RUN      ] AlignmentTest.ConsecutiveMacros
[       OK ] AlignmentTest.ConsecutiveMacros (36 ms)
[----------] 1 test from AlignmentTest (36 ms total)

[----------] 6 tests from FormatTest
[ RUN      ] FormatTest.DoesNotChangeCorrectlyFormattedCode
[       OK ] FormatTest.DoesNotChangeCorrectlyFormattedCode (0 ms)
[ RUN      ] FormatTest.EmptyLinesInMacroDefinitions
[       OK ] FormatTest.EmptyLinesInMacroDefinitions (2 ms)
[ RUN      ] FormatTest.UnderstandsPointersToMembers
[       OK ] FormatTest.UnderstandsPointersToMembers (12 ms)
[ RUN      ] FormatTest.SkipsUnknownStringLiterals
[       OK ] FormatTest.SkipsUnknownStringLiterals (1 ms)
[ RUN      ] FormatTest.UTF8CharacterLiteralCpp11
[       OK ] FormatTest.UTF8CharacterLiteralCpp11 (0 ms)
[ RUN      ] FormatTest.LambdaArrowAsTrailingReturnArrow
[       OK ] FormatTest.LambdaArrowAsTrailingReturnArrow (0 ms)
[----------] 6 tests from FormatTest (17 ms total)

[----------] 1 test from FormatTestCSharp
[ RUN      ] FormatTestCSharp.CSharpLambdasDontBreakFollowingCodeAlignment
[       OK ] FormatTestCSharp.CSharpLambdasDontBreakFollowingCodeAlignment (1 ms)
[----------] 1 test from FormatTestCSharp (1 ms total)

[----------] 1 test from FormatTestJS
[ RUN      ] FormatTestJS.EnumDeclarations
FormatTests: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:1219: bool clang::format::(anonymous namespace)::AnnotatingParser::parseBrace(): Assertion `Scopes.back() == getScopeType(OpeningBrace)' failed.
 #0 0x0000000000b3e168 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
 #1 0x0000000000b3b3a5 llvm::sys::RunSignalHandlers() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:109:18
 #2 0x0000000000b3ef71 SignalHandler(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
 #3 0x000079c6c7a59330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #4 0x000079c6c7ab2b2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
 #5 0x000079c6c7a5927e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #6 0x000079c6c7a3c8ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
 #7 0x000079c6c7a3c81b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
 #8 0x000079c6c7a4f517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
 #9 0x0000000000c11fd7 set_size /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/SmallVector.h:94:5
#10 0x0000000000c11fd7 pop_back /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/SmallVector.h:573:27
#11 0x0000000000c11fd7 clang::format::(anonymous namespace)::AnnotatingParser::parseBrace() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:1220:16
#12 0x0000000000c0d711 clang::format::(anonymous namespace)::AnnotatingParser::consumeToken() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:0:0
#13 0x0000000000c0123b clang::format::(anonymous namespace)::AnnotatingParser::parseLine() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:2073:11
#14 0x0000000000c00707 clang::format::TokenAnnotator::annotate(clang::format::AnnotatedLine&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:3828:13
#15 0x0000000000bff4ac clang::format::TokenAnalyzer::process(bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnalyzer.cpp:0:19
#16 0x0000000000bc22ba operator() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4300:5
#17 0x0000000000bc22ba __invoke_impl<std::pair<clang::tooling::Replacements, unsigned int>, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4299:23) &, const clang::format::Environment &> /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61:14
#18 0x0000000000bc22ba __invoke_r<std::pair<clang::tooling::Replacements, unsigned int>, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4299:23) &, const clang::format::Environment &> /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:114:9
#19 0x0000000000bc22ba std::_Function_handler<std::pair<clang::tooling::Replacements, unsigned int> (clang::format::Environment const&), clang::format::internal::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int, unsigned int, llvm::StringRef, clang::format::FormattingAttemptStatus*)::$_12>::_M_invoke(std::_Any_data const&, clang::format::Environment const&) /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:290:9
#20 0x0000000000ba4fe1 clang::format::internal::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int, unsigned int, llvm::StringRef, clang::format::FormattingAttemptStatus*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4316:9
#21 0x0000000000ba6083 _Rb_tree_impl /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_tree.h:689:12
#22 0x0000000000ba6083 _Rb_tree /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_tree.h:956:7
#23 0x0000000000ba6083 set /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_set.h:233:7
#24 0x0000000000ba6083 Replacements /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Tooling/Core/Replacement.h:212:7
#25 0x0000000000ba6083 clang::format::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef, clang::format::FormattingAttemptStatus*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4358:10
#26 0x00000000008ad615 AssertionResult<bool> /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/include/gtest/gtest-assertion-result.h:161:18
#27 0x00000000008ad615 clang::format::FormatTestJS::format[abi:cxx11](llvm::StringRef, unsigned int, unsigned int, clang::format::FormatStyle const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/unittests/Format/FormatTestJS.cpp:29:5
#28 0x00000000008a1f6e _M_data /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:223:28
#29 0x00000000008a1f6e _M_is_local /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:264:6
#30 0x00000000008a1f6e _M_dispose /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:282:7
#31 0x00000000008a1f6e ~basic_string /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:804:9
#32 0x00000000008a1f6e clang::format::FormatTestJS::verifyFormat(llvm::StringRef, clang::format::FormatStyle const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/unittests/Format/FormatTestJS.cpp:51:19
#33 0x00000000008a8cbc clang::format::FormatTestJS_EnumDeclarations_Test::TestBody() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/unittests/Format/FormatTestJS.cpp:1831:3
#34 0x0000000000b53a90 os_stack_trace_getter /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:6240:7
#35 0x0000000000b53a90 testing::Test::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:2695:9
#36 0x0000000000b54870 os_stack_trace_getter /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:6240:7
#37 0x0000000000b54870 testing::TestInfo::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:2842:11
#38 0x0000000000b55483 testing::TestSuite::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:3018:35
#39 0x0000000000b66694 testing::internal::UnitTestImpl::RunAllTests() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:5922:41
#40 0x0000000000b65a49 testing::UnitTest::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:5485:10
#41 0x0000000000b3fd5a main /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/UnitTestMain/TestMain.cpp:55:3
#42 0x000079c6c7a3e1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#43 0x000079c6c7a3e28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#44 0x00000000004f0265 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests+0x4f0265)

--
exit: -6
--
shard JSON output does not exist: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests-Clang-Unit-501739-10-79.json
```
</details>
<details>
<summary>Clang-Unit.Format/_/FormatTests/15/79</summary>

```
Script(shard):
--
GTEST_OUTPUT=json:/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests-Clang-Unit-501739-15-79.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=79 GTEST_SHARD_INDEX=15 /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests
--

Note: This is test shard 16 of 79.
[==========] Running 16 tests from 12 test suites.
[----------] Global test environment set-up.
[----------] 1 test from AlignmentTest
[ RUN      ] AlignmentTest.ConsecutiveCompoundAssignments
[       OK ] AlignmentTest.ConsecutiveCompoundAssignments (27 ms)
[----------] 1 test from AlignmentTest (27 ms total)

[----------] 5 tests from FormatTest
[ RUN      ] FormatTest.NestedNameSpecifiers
[       OK ] FormatTest.NestedNameSpecifiers (6 ms)
[ RUN      ] FormatTest.LayoutMacroDefinitionsStatementsSpanningBlocks
[       OK ] FormatTest.LayoutMacroDefinitionsStatementsSpanningBlocks (1 ms)
[ RUN      ] FormatTest.UnderstandsFunctionRefQualification
[       OK ] FormatTest.UnderstandsFunctionRefQualification (100 ms)
[ RUN      ] FormatTest.DoNotBreakStringLiteralsInEscapeSequence
[       OK ] FormatTest.DoNotBreakStringLiteralsInEscapeSequence (5 ms)
[ RUN      ] FormatTest.GuessLanguageWithCaret
[       OK ] FormatTest.GuessLanguageWithCaret (0 ms)
[----------] 5 tests from FormatTest (115 ms total)

[----------] 1 test from FormatTestComments
[ RUN      ] FormatTestComments.AlignsBlockComments
[       OK ] FormatTestComments.AlignsBlockComments (6 ms)
[----------] 1 test from FormatTestComments (7 ms total)

[----------] 1 test from FormatTestCSharp
[ RUN      ] FormatTestCSharp.CSharpNamedArguments
[       OK ] FormatTestCSharp.CSharpNamedArguments (1 ms)
[----------] 1 test from FormatTestCSharp (1 ms total)

[----------] 1 test from FormatTestJS
[ RUN      ] FormatTestJS.Modules
FormatTests: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:1219: bool clang::format::(anonymous namespace)::AnnotatingParser::parseBrace(): Assertion `Scopes.back() == getScopeType(OpeningBrace)' failed.
 #0 0x0000000000b3e168 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
 #1 0x0000000000b3b3a5 llvm::sys::RunSignalHandlers() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:109:18
 #2 0x0000000000b3ef71 SignalHandler(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
 #3 0x00007b320ed92330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #4 0x00007b320edebb2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
 #5 0x00007b320ed9227e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #6 0x00007b320ed758ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
 #7 0x00007b320ed7581b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
 #8 0x00007b320ed88517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
 #9 0x0000000000c11fd7 set_size /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/SmallVector.h:94:5
#10 0x0000000000c11fd7 pop_back /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/SmallVector.h:573:27
#11 0x0000000000c11fd7 clang::format::(anonymous namespace)::AnnotatingParser::parseBrace() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:1220:16
#12 0x0000000000c0d711 clang::format::(anonymous namespace)::AnnotatingParser::consumeToken() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:0:0
#13 0x0000000000c0123b clang::format::(anonymous namespace)::AnnotatingParser::parseLine() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:2073:11
#14 0x0000000000c00707 clang::format::TokenAnnotator::annotate(clang::format::AnnotatedLine&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:3828:13
#15 0x0000000000bff4ac clang::format::TokenAnalyzer::process(bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnalyzer.cpp:0:19
#16 0x0000000000bc22ba operator() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4300:5
#17 0x0000000000bc22ba __invoke_impl<std::pair<clang::tooling::Replacements, unsigned int>, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4299:23) &, const clang::format::Environment &> /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61:14
#18 0x0000000000bc22ba __invoke_r<std::pair<clang::tooling::Replacements, unsigned int>, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4299:23) &, const clang::format::Environment &> /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:114:9
#19 0x0000000000bc22ba std::_Function_handler<std::pair<clang::tooling::Replacements, unsigned int> (clang::format::Environment const&), clang::format::internal::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int, unsigned int, llvm::StringRef, clang::format::FormattingAttemptStatus*)::$_12>::_M_invoke(std::_Any_data const&, clang::format::Environment const&) /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:290:9
#20 0x0000000000ba4fe1 clang::format::internal::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int, unsigned int, llvm::StringRef, clang::format::FormattingAttemptStatus*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4316:9
#21 0x0000000000ba6083 _Rb_tree_impl /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_tree.h:689:12
#22 0x0000000000ba6083 _Rb_tree /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_tree.h:956:7
#23 0x0000000000ba6083 set /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_set.h:233:7
#24 0x0000000000ba6083 Replacements /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Tooling/Core/Replacement.h:212:7
#25 0x0000000000ba6083 clang::format::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef, clang::format::FormattingAttemptStatus*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4358:10
#26 0x00000000008ad615 AssertionResult<bool> /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/include/gtest/gtest-assertion-result.h:161:18
#27 0x00000000008ad615 clang::format::FormatTestJS::format[abi:cxx11](llvm::StringRef, unsigned int, unsigned int, clang::format::FormatStyle const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/unittests/Format/FormatTestJS.cpp:29:5
#28 0x00000000008a1f6e _M_data /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:223:28
#29 0x00000000008a1f6e _M_is_local /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:264:6
#30 0x00000000008a1f6e _M_dispose /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:282:7
#31 0x00000000008a1f6e ~basic_string /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:804:9
#32 0x00000000008a1f6e clang::format::FormatTestJS::verifyFormat(llvm::StringRef, clang::format::FormatStyle const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/unittests/Format/FormatTestJS.cpp:51:19
#33 0x00000000008a95b3 clang::format::FormatTestJS_Modules_Test::TestBody() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/unittests/Format/FormatTestJS.cpp:1980:3
#34 0x0000000000b53a90 os_stack_trace_getter /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:6240:7
#35 0x0000000000b53a90 testing::Test::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:2695:9
#36 0x0000000000b54870 os_stack_trace_getter /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:6240:7
#37 0x0000000000b54870 testing::TestInfo::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:2842:11
#38 0x0000000000b55483 testing::TestSuite::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:3018:35
#39 0x0000000000b66694 testing::internal::UnitTestImpl::RunAllTests() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:5922:41
#40 0x0000000000b65a49 testing::UnitTest::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:5485:10
#41 0x0000000000b3fd5a main /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/UnitTestMain/TestMain.cpp:55:3
#42 0x00007b320ed771ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#43 0x00007b320ed7728b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#44 0x00000000004f0265 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests+0x4f0265)

--
exit: -6
--
shard JSON output does not exist: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests-Clang-Unit-501739-15-79.json
```
</details>
<details>
<summary>Clang-Unit.Format/_/FormatTests/37/79</summary>

```
Script(shard):
--
GTEST_OUTPUT=json:/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests-Clang-Unit-501739-37-79.json GTEST_SHUFFLE=0 GTEST_TOTAL_SHARDS=79 GTEST_SHARD_INDEX=37 /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests
--

Note: This is test shard 38 of 79.
[==========] Running 16 tests from 11 test suites.
[----------] Global test environment set-up.
[----------] 1 test from CleanupTest
[ RUN      ] CleanupTest.EmptyNamespaceWithCommentsBreakBeforeBrace
[       OK ] CleanupTest.EmptyNamespaceWithCommentsBreakBeforeBrace (0 ms)
[----------] 1 test from CleanupTest (0 ms total)

[----------] 5 tests from FormatTest
[ RUN      ] FormatTest.ShortEnums
[       OK ] FormatTest.ShortEnums (14 ms)
[ RUN      ] FormatTest.NoOperandAlignment
[       OK ] FormatTest.NoOperandAlignment (9 ms)
[ RUN      ] FormatTest.FormatsArrays
[       OK ] FormatTest.FormatsArrays (20 ms)
[ RUN      ] FormatTest.AllmanBraceBreaking
[       OK ] FormatTest.AllmanBraceBreaking (56 ms)
[ RUN      ] FormatTest.PenaltyIndentedWhitespace
[       OK ] FormatTest.PenaltyIndentedWhitespace (7 ms)
[----------] 5 tests from FormatTest (109 ms total)

[----------] 1 test from FormatTestComments
[ RUN      ] FormatTestComments.ReflowsComments
[       OK ] FormatTestComments.ReflowsComments (74 ms)
[----------] 1 test from FormatTestComments (74 ms total)

[----------] 2 tests from FormatTestJS
[ RUN      ] FormatTestJS.ReservedWordsParenthesized
[       OK ] FormatTestJS.ReservedWordsParenthesized (1 ms)
[ RUN      ] FormatTestJS.CppKeywords
FormatTests: /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:1219: bool clang::format::(anonymous namespace)::AnnotatingParser::parseBrace(): Assertion `Scopes.back() == getScopeType(OpeningBrace)' failed.
 #0 0x0000000000b3e168 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:880:13
 #1 0x0000000000b3b3a5 llvm::sys::RunSignalHandlers() /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Signals.cpp:109:18
 #2 0x0000000000b3ef71 SignalHandler(int, siginfo_t*, void*) /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/lib/Support/Unix/Signals.inc:448:38
 #3 0x0000785213ef8330 (/lib/x86_64-linux-gnu/libc.so.6+0x45330)
 #4 0x0000785213f51b2c pthread_kill (/lib/x86_64-linux-gnu/libc.so.6+0x9eb2c)
 #5 0x0000785213ef827e raise (/lib/x86_64-linux-gnu/libc.so.6+0x4527e)
 #6 0x0000785213edb8ff abort (/lib/x86_64-linux-gnu/libc.so.6+0x288ff)
 #7 0x0000785213edb81b (/lib/x86_64-linux-gnu/libc.so.6+0x2881b)
 #8 0x0000785213eee517 (/lib/x86_64-linux-gnu/libc.so.6+0x3b517)
 #9 0x0000000000c11fd7 set_size /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/SmallVector.h:94:5
#10 0x0000000000c11fd7 pop_back /home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include/llvm/ADT/SmallVector.h:573:27
#11 0x0000000000c11fd7 clang::format::(anonymous namespace)::AnnotatingParser::parseBrace() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:1220:16
#12 0x0000000000c0d711 clang::format::(anonymous namespace)::AnnotatingParser::consumeToken() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:0:0
#13 0x0000000000c0123b clang::format::(anonymous namespace)::AnnotatingParser::parseLine() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:2073:11
#14 0x0000000000c00707 clang::format::TokenAnnotator::annotate(clang::format::AnnotatedLine&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnnotator.cpp:3828:13
#15 0x0000000000bff4ac clang::format::TokenAnalyzer::process(bool) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/TokenAnalyzer.cpp:0:19
#16 0x0000000000bc22ba operator() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4300:5
#17 0x0000000000bc22ba __invoke_impl<std::pair<clang::tooling::Replacements, unsigned int>, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4299:23) &, const clang::format::Environment &> /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:61:14
#18 0x0000000000bc22ba __invoke_r<std::pair<clang::tooling::Replacements, unsigned int>, (lambda at /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4299:23) &, const clang::format::Environment &> /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/invoke.h:114:9
#19 0x0000000000bc22ba std::_Function_handler<std::pair<clang::tooling::Replacements, unsigned int> (clang::format::Environment const&), clang::format::internal::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int, unsigned int, llvm::StringRef, clang::format::FormattingAttemptStatus*)::$_12>::_M_invoke(std::_Any_data const&, clang::format::Environment const&) /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/std_function.h:290:9
#20 0x0000000000ba4fe1 clang::format::internal::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, unsigned int, unsigned int, unsigned int, llvm::StringRef, clang::format::FormattingAttemptStatus*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4316:9
#21 0x0000000000ba6083 _Rb_tree_impl /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_tree.h:689:12
#22 0x0000000000ba6083 _Rb_tree /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_tree.h:956:7
#23 0x0000000000ba6083 set /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/stl_set.h:233:7
#24 0x0000000000ba6083 Replacements /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include/clang/Tooling/Core/Replacement.h:212:7
#25 0x0000000000ba6083 clang::format::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef, clang::format::FormattingAttemptStatus*) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/Format/Format.cpp:4358:10
#26 0x00000000008ad615 AssertionResult<bool> /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/include/gtest/gtest-assertion-result.h:161:18
#27 0x00000000008ad615 clang::format::FormatTestJS::format[abi:cxx11](llvm::StringRef, unsigned int, unsigned int, clang::format::FormatStyle const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/unittests/Format/FormatTestJS.cpp:29:5
#28 0x00000000008a1f6e _M_data /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:223:28
#29 0x00000000008a1f6e _M_is_local /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:264:6
#30 0x00000000008a1f6e _M_dispose /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:282:7
#31 0x00000000008a1f6e ~basic_string /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/basic_string.h:804:9
#32 0x00000000008a1f6e clang::format::FormatTestJS::verifyFormat(llvm::StringRef, clang::format::FormatStyle const&) /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/unittests/Format/FormatTestJS.cpp:51:19
#33 0x00000000008ab238 clang::format::FormatTestJS_CppKeywords_Test::TestBody() /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/unittests/Format/FormatTestJS.cpp:2519:3
#34 0x0000000000b53a90 os_stack_trace_getter /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:6240:7
#35 0x0000000000b53a90 testing::Test::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:2695:9
#36 0x0000000000b54870 os_stack_trace_getter /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:6240:7
#37 0x0000000000b54870 testing::TestInfo::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:2842:11
#38 0x0000000000b55483 testing::TestSuite::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:3018:35
#39 0x0000000000b66694 testing::internal::UnitTestImpl::RunAllTests() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:5922:41
#40 0x0000000000b65a49 testing::UnitTest::Run() /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/googletest/src/gtest.cc:5485:10
#41 0x0000000000b3fd5a main /home/gha/actions-runner/_work/llvm-project/llvm-project/third-party/unittest/UnitTestMain/TestMain.cpp:55:3
#42 0x0000785213edd1ca (/lib/x86_64-linux-gnu/libc.so.6+0x2a1ca)
#43 0x0000785213edd28b __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2a28b)
#44 0x00000000004f0265 _start (/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests+0x4f0265)

--
exit: -6
--
shard JSON output does not exist: /home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/unittests/Format/./FormatTests-Clang-Unit-501739-37-79.json
```
</details>

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.

https://github.com/llvm/llvm-project/pull/194154


More information about the cfe-commits mailing list