| Issue |
185268
|
| Summary |
[clang-format] Assertion `(!TypeIsFinalized || T == Type) && "Please use overwriteFixedType to change a fixed type."' failed.
|
| Labels |
clang-format
|
| Assignees |
|
| Reporter |
k-arrows
|
Reproducer:
```cpp
void foo()([] consteval -> int {}())
```
Assertion failure:
```console
clang-format: /path_to_project/llvm-project/clang/lib/Format/FormatToken.h:460: void clang::format::FormatToken::setType(clang::format::TokenType): Assertion `(!TypeIsFinalized || T == Type) && "Please use overwriteFixedType to change a fixed type."' failed.
```
Backtrace:
```console
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and instructions to reproduce the bug.
Stack dump:
0. Program arguments: clang-format test.cpp
#0 0x000074b31b9ccde7 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
#1 0x000074b31b9c9cc5 llvm::sys::RunSignalHandlers()
#2 0x000074b31b9cdc15 SignalHandler(int, siginfo_t*, void*) Signals.cpp:0:0
#3 0x000074b31b042520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#4 0x000074b31b0969fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#5 0x000074b31b0969fc __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#6 0x000074b31b0969fc pthread_kill ./nptl/pthread_kill.c:89:10
#7 0x000074b31b042476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#8 0x000074b31b0287f3 abort ./stdlib/abort.c:81:7
#9 0x000074b31b02871b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#10 0x000074b31b039e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#11 0x000074b31c38542e
#12 0x000074b31c3abd32 clang::format::TokenAnnotator::calculateFormattingInformation(clang::format::AnnotatedLine&) const
#13 0x000074b31c361b8d clang::format::(anonymous namespace)::Formatter::analyze(clang::format::TokenAnnotator&, llvm::SmallVectorImpl<clang::format::AnnotatedLine*>&, clang::format::FormatTokenLexer&) Format.cpp:0:0
#14 0x000074b31c3a713b clang::format::TokenAnalyzer::process(bool)
#15 0x000074b31c37a66e 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*)::$_18>::_M_invoke(std::_Any_data const&, clang::format::Environment const&) Format.cpp:0:0
#16 0x000074b31c35868e 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*)
#17 0x000074b31c359eb3 clang::format::reformat(clang::format::FormatStyle const&, llvm::StringRef, llvm::ArrayRef<clang::tooling::Range>, llvm::StringRef, clang::format::FormattingAttemptStatus*)
#18 0x0000638562b8c278 clang::format::format(llvm::StringRef, bool) ClangFormat.cpp:0:0
#19 0x0000638562b8a186 main
#20 0x000074b31b029d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#21 0x000074b31b029e40 call_init ./csu/../csu/libc-start.c:128:20
#22 0x000074b31b029e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#23 0x0000638562b86835 _start
Aborted (core dumped)
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs