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

    <tr>
        <th>Summary</th>
        <td>
            clang-tidy crash with invalid input
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    https://godbolt.org/z/jjh5KvWs6

```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: /clang-tidy -checks=misc-confusable-identifiers <source>
1.      <eof> parser at end of file
2.      ASTMatcher: Processing 'misc-confusable-identifiers' against:
        TemplateTypeParmDecl std::allocator<char32_t>::rebind::_Tp1 : </opt/compiler-explorer/gcc-9.2.0/lib/gcc/x86_64-linux-gnu/9.2.0/../../../../include/c++/9.2.0/bits/allocator.h:123:16, col:25>
--- Bound Nodes Begin ---
    nameddecl - { TemplateTypeParmDecl std::allocator<char32_t>::rebind::_Tp1 : </opt/compiler-explorer/gcc-9.2.0/lib/gcc/x86_64-linux-gnu/9.2.0/../../../../include/c++/9.2.0/bits/allocator.h:123:16, col:25> }
--- Bound Nodes End ---
 #0 0x00005648c9380e9f PrintStackTraceSignalHandler(void*) Signals.cpp:0:0
 #1 0x00005648c937e73c SignalHandler(int) Signals.cpp:0:0
 #2 0x00007faacb9653c0 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x143c0)
 #3 0x00005648c8503a8a clang::CXXRecordDecl::forallBases(llvm::function_ref<bool (clang::CXXRecordDecl const*)>) const (/clang-tidy+0x3503a8a)
 #4 0x00005648c6249b5e clang::tidy::misc::ConfusableIdentifierCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) (/clang-tidy+0x1249b5e)
 #5 0x00005648c835d0f9 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch(clang::ast_matchers::BoundNodes const&) ASTMatchFinder.cpp:0:0
 #6 0x00005648c83a2268 clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor*) (/clang-tidy+0x33a2268)
 #7 0x00005648c835f844 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchWithFilter(clang::DynTypedNode const&) ASTMatchFinder.cpp:0:0
 #8 0x00005648c8381478 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) ASTMatchFinder.cpp:0:0
 #9 0x00005648c838ebac clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseTemplateParameterListHelper(clang::TemplateParameterList*) ASTMatchFinder.cpp:0:0
#10 0x00005648c839b31d clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseClassTemplateDecl(clang::ClassTemplateDecl*) ASTMatchFinder.cpp:0:0
#11 0x00005648c8382d74 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) ASTMatchFinder.cpp:0:0
#12 0x00005648c83839da clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) (.part.6322) ASTMatchFinder.cpp:0:0
#13 0x00005648c8382c6f clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) ASTMatchFinder.cpp:0:0
#14 0x00005648c839b4a7 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseClassTemplateDecl(clang::ClassTemplateDecl*) ASTMatchFinder.cpp:0:0
#15 0x00005648c8382d74 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) ASTMatchFinder.cpp:0:0
#16 0x00005648c83839da clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) (.part.6322) ASTMatchFinder.cpp:0:0
#17 0x00005648c838197c clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) ASTMatchFinder.cpp:0:0
#18 0x00005648c83839da clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseDeclContextHelper(clang::DeclContext*) (.part.6322) ASTMatchFinder.cpp:0:0
#19 0x00005648c839bf88 clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseTranslationUnitDecl(clang::TranslationUnitDecl*) ASTMatchFinder.cpp:0:0
#20 0x00005648c83814b9 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) ASTMatchFinder.cpp:0:0
#21 0x00005648c8383659 clang::ast_matchers::MatchFinder::matchAST(clang::ASTContext&) (/clang-tidy+0x3383659)
#22 0x00005648c75c1268 clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) (/clang-tidy+0x25c1268)
#23 0x00005648c77e1c29 clang::ParseAST(clang::Sema&, bool, bool) (/clang-tidy+0x27e1c29)
#24 0x00005648c758bdf1 clang::FrontendAction::Execute() (/clang-tidy+0x258bdf1)
#25 0x00005648c751d862 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/clang-tidy+0x251d862)
#26 0x00005648c6e3830f clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) (/clang-tidy+0x1e3830f)
#27 0x00005648c6ddc7ee clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, bool, llvm::StringRef)::ActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) ClangTidy.cpp:0:0
#28 0x00005648c6e2f0dc clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) (/clang-tidy+0x1e2f0dc)
#29 0x00005648c6e32fe7 clang::tooling::ToolInvocation::run() (/clang-tidy+0x1e32fe7)
#30 0x00005648c6e365b6 clang::tooling::ClangTool::run(clang::tooling::ToolAction*) (/clang-tidy+0x1e365b6)
#31 0x00005648c6de1224 clang::tidy::runClangTidy(clang::tidy::ClangTidyContext&, clang::tooling::CompilationDatabase const&, llvm::ArrayRef<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, llvm::IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>, bool, bool, llvm::StringRef) (/clang-tidy+0x1de1224)
#32 0x00005648c5f92141 clang::tidy::clangTidyMain(int, char const**) (/clang-tidy+0xf92141)
#33 0x00007faacb4190b3 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x240b3)
#34 0x00005648c5f88d7a _start (/clang-tidy+0xf88d7a)
```

I am not sure what is actually going on here and how to reproduce this outside of godbolt. I stumbled on this by accident when I wanted to figure out the version of the build used in godbolt.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztWltz2zYW_jXyC0Ya3i8PerBlZ-LZZuuJvdu-aUAQlJBSBAcAbWl_fQ8AiSJoybHbeJpsm9iyCIDnfOc7F1zIgpe7-VqpVk7Cy0nwAX5WvCx4rWZcrODqf_D75cs6_tfjLzKZeNcT73L_mXj7H3N599PN5f0Nkl2xYQphVHQrJGjLhUKKo5EGptZdMSN8Axd1_Xj4M20F_0KJgksmZUclfEG4KRFrSN2VFKk1RURguUYFJr8pgQmdWfX3ChpQ2W1arcU0edCV3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