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

    <tr>
        <th>Summary</th>
        <td>
            Segmentation Fault running clang-tidy
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          phantom-jacob
      </td>
    </tr>
</table>

<pre>
    Ubuntu 22.04, LLVM 17:
```
/usr/bin/clang-tidy-17 --fix --extra-arg-before=--driver-mode=g++ /home/jacobd/git/phantom/alchemy/libutil_v2/pretty_print.cpp -- /usr/bin/g++ -DDEV -DPHANTOM_CLOUD -I/home/jacobd/git/phantom/alchemy -I/home/jacobd/git/phantom/build/alchemy -I/home/jacobd/git/phantom/build/schema -isystem /home/jacobd/.conan/data/boost/1.83.0/_/_/package/1714959b53650488b37c41cd3a9ade3fb312129e/include -isystem /home/jacobd/.conan/data/protobuf/3.15.8/_/_/package/2174169f0a98f7948e48a1ac4492bd66e02fcec8/include -isystem /home/jacobd/.conan/data/zlib/1.3.1/_/_/package/af11149481c69e4ca43a19f2690848b74023e63e/include -Wno-unused-command-line-argument -O2 -g -DNDEBUG -fPIC -pipe -Wall -Werror -Wdelete-non-virtual-dtor -ggdb -DSHOULD_LOG_IPC -fcoroutines -std=gnu++2a -MD -MT alchemy/libutil_v2/CMakeFiles/util_v2.dir/pretty_print.cpp.o -MF alchemy/libutil_v2/CMakeFiles/util_v2.dir/pretty_print.cpp.o.d -o alchemy/libutil_v2/CMakeFiles/util_v2.dir/pretty_print.cpp.o -c /home/jacobd/git/phantom/alchemy/libutil_v2/pretty_print.cpp
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /usr/bin/clang-tidy-17 --fix --extra-arg-before=--driver-mode=g++ /home/jacobd/git/phantom/alchemy/libutil_v2/pretty_print.cpp -- /usr/bin/g++ -DDEV -DPHANTOM_CLOUD -I/home/jacobd/git/phantom/alchemy -I/home/jacobd/git/phantom/build/alchemy -I/home/jacobd/git/phantom/build/schema -isystem /home/jacobd/.conan/data/boost/1.83.0/_/_/package/1714959b53650488b37c41cd3a9ade3fb312129e/include -isystem /home/jacobd/.conan/data/protobuf/3.15.8/_/_/package/2174169f0a98f7948e48a1ac4492bd66e02fcec8/include -isystem /home/jacobd/.conan/data/zlib/1.3.1/_/_/package/af11149481c69e4ca43a19f2690848b74023e63e/include -Wno-unused-command-line-argument -O2 -g -DNDEBUG -fPIC -pipe -Wall -Werror -Wdelete-non-virtual-dtor -ggdb -DSHOULD_LOG_IPC -fcoroutines -std=gnu++2a -MD -MT alchemy/libutil_v2/CMakeFiles/util_v2.dir/pretty_print.cpp.o -MF alchemy/libutil_v2/CMakeFiles/util_v2.dir/pretty_print.cpp.o.d -o alchemy/libutil_v2/CMakeFiles/util_v2.dir/pretty_print.cpp.o -c /home/jacobd/git/phantom/alchemy/libutil_v2/pretty_print.cpp
 #0 0x0000776be2ccc406 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xccc406)
 #1 0x0000776be2cca5b0 llvm::sys::RunSignalHandlers() (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xcca5b0)
 #2 0x0000776be2ccca9b (/usr/lib/llvm-17/bin/../lib/libLLVM-17.so.1+0xccca9b)
 #3 0x0000776be1842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x0000606037df1cec clang::tidy::ClangTidyContext::diag(llvm::StringRef, llvm::StringRef, clang::DiagnosticIDs::Level) (/usr/bin/clang-tidy-17+0x137bcec)
 #5 0x0000606037df177a clang::tidy::ClangTidyContext::setCurrentFile(llvm::StringRef) (/usr/bin/clang-tidy-17+0x137b77a)
 #6 0x0000606037de4e2f clang::tidy::getCheckNames[abi:cxx11](clang::tidy::ClangTidyOptions const&, bool) (/usr/bin/clang-tidy-17+0x136ee2f)
 #7 0x00006060370e4113 clang::tidy::clangTidyMain(int, char const**) (/usr/bin/clang-tidy-17+0x66e113)
 #8 0x0000776be1829d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
 #9 0x0000776be1829e40 call_init ./csu/../csu/libc-start.c:128:20
#10 0x0000776be1829e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#11 0x00006060370e0e65 _start (/usr/bin/clang-tidy-17+0x66ae65)
[1]    581833 segmentation fault (core dumped)  /usr/bin/clang-tidy-17 --fix --extra-arg-before=--driver-mode=g++  --  -DDEV
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsWE1v27oS_TX0hqDAD30uvHDs-rZA0gQ37e3SoKiRzEYmDZLKc96vf6CUxLXhPqRFFndRwEEkinPmzHDmkJL0XncGYI6yK5StZnIIW-vm-600we7Id6lsPatt8zT_Wg8mDJjzhKaIL_H19T83mBVILBBdIbpAOX3-Tbd8PXiH-LrWBvG16qXpSNDNE2EFJqTVB0wIHIKTRLqO1NBaB0isCGmcfgRHdraJ9x3iV4hfYcTXW7sDxNcjpwbxdacD4utnqoivZa-2sHtCfN3regi63zzyOMFBCE-bvdMmJGq_x4TgM3YvTshq9eEfTFZ3Hxefv9zebJbXt19XmHx6u_O3Ta4H3Te_a-SjjcRE-ycfYHcpM4myRsbAGhlkNLXWRzCWlCKhiK83z397qR5kF21ZwdIqq-pM5BlNy7IWhUqZaoSsZAOirQXjjFdxqjaqHxr4JQZ7Z4OthxbxtUhYlpQXSXBWpCyvWiqrsi2qtIS0lEyqNK143eQ5UN4qUOVvkvhvr-sxCyJhF_3LljGWVmnJVF5BqmQqJKtanle0TMu6SCkXkIuTJHwzlgxm8NAQZXc7aRrSawOxqocdmIDJLcekw2T1efXh6utfmLR3n5aY7PU-Wsu-x-QbOGcdJt8a6CEAMdaQR-3CIHvShPik65oak9X9x9uv16vN9e1fm093S0xaZ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