llvm-project
llvm-project copied to clipboard
clang assert `!isAnnotation() && "Annotation tokens have no length field"' failed.
example in: https://godbolt.org/z/bnGdGr8Wh
The assert only happen when emit-pch and -fdelayed-template-parsing are used and with use of "pragma unroll"
clang++: /root/llvm-project/clang/include/clang/Lex/Token.h:129: unsigned int clang::Token::getLength() const: Assertion `!isAnnotation() && "Annotation tokens have no length field"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk/bin/clang++ -gdwarf-4 -g -o /app/output.s -mllvm --x86-asm-syntax=intel -S --gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics -fno-crash-diagnostics -Xclang -emit-pch -fdelayed-template-parsing <source>
1. <eof> parser at end of file
#0 0x000055649e2ebf94 PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
#1 0x000055649e2e9d2c llvm::sys::CleanupOnSignal(unsigned long) (/opt/compiler-explorer/clang-assertions-trunk/bin/clang+++0x3fb5d2c)
#2 0x000055649e224f88 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#3 0x00007f5356600420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x00007f53560cd00b raise (/lib/x86_64-linux-gnu/libc.so.6+0x4300b)
#5 0x00007f53560ac859 abort (/lib/x86_64-linux-gnu/libc.so.6+0x22859)
#6 0x00007f53560ac729 (/lib/x86_64-linux-gnu/libc.so.6+0x22729)
Confirmed this look like: https://github.com/llvm/llvm-project/issues/39504
@llvm/issue-subscribers-clang-frontend