<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58848>58848</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            clang assert `!isAnnotation() && "Annotation tokens have no length field"' failed.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          jyu2-git
      </td>
    </tr>
</table>

<pre>
    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+0x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