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

    <tr>
        <th>Summary</th>
        <td>
            clang-format Assertion failed: ((!TypeIsFinalized || T == Type) && "Please use overwriteFixedType to change a fixed type.")
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          nbriggs
      </td>
    </tr>
</table>

<pre>
    I accidentally included a SPARC assembly file in the files that clang-format was to process - it resulted in this assertion failure:
```
% clang-format-devel --style=file -i src/bbtSPARC.s
Assertion failed: ((!TypeIsFinalized || T == Type) && "Please use overwriteFixedType to change a fixed type."), function setType, file /wrkdirs/usr/ports/devel/llvm-devel/work-default/llvm-project-d98519715617a462c3ebadc778558b717354b6d2/clang/lib/Format/FormatToken.h, line 441.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /usr/local/llvm-devel/bin/clang-format --style=file -i src/bbtSPARC.s
#0 0x29699a39 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/local/llvm-devel/lib/libLLVM.so.20.0git+0x4299a39)
#1 0x29699f5d (/usr/local/llvm-devel/lib/libLLVM.so.20.0git+0x4299f5d)
#2 0x296977cb llvm::sys::RunSignalHandlers() (/usr/local/llvm-devel/lib/libLLVM.so.20.0git+0x42977cb)
#3 0x2969a138 (/usr/local/llvm-devel/lib/libLLVM.so.20.0git+0x429a138)
#4 0x20473d69 (/lib/libthr.so.3+0x18d69)
zsh: abort (core dumped)  clang-format-devel --style=file -i src/bbtSPARC.s
```
I've pruned the input down to something small that still causes the crash and attached it here.  I don't expect it to do anything reasonable to the file -- but I don't think it should crash with an assertion failure.
[bbtSPARC.txt](https://github.com/user-attachments/files/17604992/bbtSPARC.txt)


</pre>
<img width="1px" height="1px"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