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

    <tr>
        <th>Summary</th>
        <td>
            [clang-tidy] SuspiciousCallArgumentCheck "Name is not a simple identifier" assertion
        </td>
    </tr>

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

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

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

<pre>
    Consider this code:

```C++
template <typename a> class b {
public:
  b(a);
};
class c {
public:
  template <int d> c(const char (&)[d]);
};
class C;
int operator-(const C &, const C &);
class e {
public:
  e(int);
  void f(c, b<int(const C &, const C &)>);
};
int g;
void h() { e(g).f("", operator-); }
```

When executing the `clang-tidy -checks=-*,readability-suspicious-call-argument FileCheck2.cpp`, it crash with the following trace:

```
0.      Program arguments: build/release/bin/clang-tidy -checks=-*,readability-suspicious-call-argument FileCheck.cpp
1.      <eof> parser at end of file
 #0 0x00007f986dc6d473 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (build/release/bin/../lib/libLLVMSupport.so.15git+0x218473)
 #1 0x00007f986dc6b22e llvm::sys::RunSignalHandlers() (build/release/bin/../lib/libLLVMSupport.so.15git+0x21622e)
 #2 0x00007f986dc6d93f SignalHandler(int) Signals.cpp:0:0
 #3 0x00007f986fdf7980 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x12980)
 #4 0x00007f986ccdffb7 raise /build/glibc-S9d2JN/glibc-2.27/signal/../sysdeps/unix/sysv/linux/raise.c:51:0
 #5 0x00007f986cce1921 abort /build/glibc-S9d2JN/glibc-2.27/stdlib/abort.c:81:0
 #6 0x00007f986ccd148a __assert_fail_base /build/glibc-S9d2JN/glibc-2.27/assert/assert.c:89:0
 #7 0x00007f986ccd1502 (/lib/x86_64-linux-gnu/libc.so.6+0x30502)
 #8 0x00007f986f1009c1 (build/release/bin/../lib/libclangTidyReadabilityModule.so.15git+0x2289c1)
 #9 0x00007f986f0ffc99 clang::tidy::readability::SuspiciousCallArgumentCheck::check(clang::ast_matchers::MatchFinder::MatchResult const&) (build/release/bin/../lib/libclangTidyReadabilityModule.so.15git+0x227c99)
#10 0x00007f986edcb6c2 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::MatchVisitor::visitMatch(clang::ast_matchers::BoundNodes const&) ASTMatchFinder.cpp:0:0
#11 0x00007f986edfd93c clang::ast_matchers::internal::BoundNodesTreeBuilder::visitMatches(clang::ast_matchers::internal::BoundNodesTreeBuilder::Visitor*) (build/release/bin/../lib/libclangASTMatchers.so.15git+0xac93c)
#12 0x00007f986edcad3a clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::matchWithFilter(clang::DynTypedNode const&) ASTMatchFinder.cpp:0:0
#13 0x00007f986edcd697 clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) ASTMatchFinder.cpp:0:0
#14 0x00007f986edd6b9b clang::RecursiveASTVisitor<clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor>::TraverseTranslationUnitDecl(clang::TranslationUnitDecl*) ASTMatchFinder.cpp:0:0
#15 0x00007f986edcde4a clang::ast_matchers::internal::(anonymous namespace)::MatchASTVisitor::TraverseDecl(clang::Decl*) ASTMatchFinder.cpp:0:0
#16 0x00007f986ed97c61 clang::ast_matchers::MatchFinder::matchAST(clang::ASTContext&) (build/release/bin/../lib/libclangASTMatchers.so.15git+0x46c61)
#17 0x00007f986bb4512c clang::MultiplexConsumer::HandleTranslationUnit(clang::ASTContext&) (build/release/bin/../lib/../lib/libclangFrontend.so.15git+0x1f712c)
#18 0x00007f986757d8a4 clang::ParseAST(clang::Sema&, bool, bool) (build/release/bin/../lib/../lib/../lib/libclangParse.so.15git+0x638a4)
#19 0x00007f986bb05810 clang::FrontendAction::Execute() (build/release/bin/../lib/../lib/libclangFrontend.so.15git+0x1b7810)
#20 0x00007f986ba57fff clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (build/release/bin/../lib/../lib/libclangFrontend.so.15git+0x109fff)
#21 0x00007f986ee67c7d clang::tooling::FrontendActionFactory::runInvocation(std::shared_ptr<clang::CompilerInvocation>, clang::FileManager*, std::shared_ptr<clang::PCHContainerOperations>, clang::DiagnosticConsumer*) (build/release/bin/../lib/libclangTooling.so.15git+0x42c7d)
#22 0x00007f986eea24b6 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
#23 0x00007f986ee679da clang::tooling::ToolInvocation::runInvocation(char const*, clang::driver::Compilation*, std::shared_ptr<clang::CompilerInvocation>, std::shared_ptr<clang::PCHContainerOperations>) (build/release/bin/../lib/libclangTooling.so.15git+0x429da)
#24 0x00007f986ee667d3 clang::tooling::ToolInvocation::run() (build/release/bin/../lib/libclangTooling.so.15git+0x417d3)
#25 0x00007f986ee694ee clang::tooling::ClangTool::run(clang::tooling::ToolAction*) (build/release/bin/../lib/libclangTooling.so.15git+0x444ee)
#26 0x00007f986ee9ce4a 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) (build/release/bin/../lib/libclangTidy.so.15git+0x28e4a)
#27 0x00007f987020806d clang::tidy::clangTidyMain(int, char const**) (build/release/bin/../lib/libclangTidyMain.so.15git+0xb06d)
#28 0x00007f986ccc2bf7 __libc_start_main /build/glibc-S9d2JN/glibc-2.27/csu/../csu/libc-start.c:344:0
#29 0x0000000000201c2a _start (build/release/bin/clang-tidy+0x201c2a)
```

I'm using the commit 2f906683ed14668ceed1f85922789abffd8429fd, `Wed Feb 23 17:00:04 2022 +0100`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJztWVtv4zoO_jXpi5DAlu8PfUidCc4sTucU0-6Zx0CW5EQ7jh1Icqf990vJjmO5l0m7LRZYbJEmkWyT30dSJKUUDXu8zJtaCcYl0juhEG0YnwXLmbeaecf32Ote-QxfmZed1Xx_qIjmaBbk-vHAa7LniMyCL4hWRClUoFnS33poi0rQQSpCxQynZIazWdDfMUtWw_fucfrK42PVotaIWa0gkwIVjeiOSASjGY6NjuiKzaLV69ryYWzkNQcuiW7kfBCZIyssR84wm0jhr2DmIAtkjx9C6L4RDJVGi5FddHR-r_TLS2QM-O0wstJ31hCZQWYxbGGwKO0ktq98TNeIRUai6_hxNPzY8RrxB05bLeotBA2wjj0wQL2da8Ee0ZzuOP2pZsEKBC5BgeSEkUJUQj_OVasOgoqmVXNKqmpO5Lbdc4C9FhXPzYN4QQ8HoxOQCXCmJGqHfgm9s6rKpqqaX1axJPTFSO2G3gLZvxvZbCXZo6MywLZERSsqNsNryStOFJhmXYga3j-OiSVigfg9EHAwb0oTrQciFSw5ohGvGWpKVMJTfVjMcOAh78GDv6TM0pjRmIVJgKrqfm8IB0v1qLovNxJcfqsJ_XlnzYHT002S_No0SgPmfR9HXfyZpfES-cUC3ipRdO9__vn39W17ODRSL1Sz8KOtAAFX3gP2UwBkwmVA7E8QFxjz5xB_b-tbsa1J9QepWcWlOsbnB4CKQacDCk_NmAUlctQPq7KfVtZpwdKz_4OgYCyoZGWSpR7abCRXsG74Ruou3_QoH9J4E4fzStTtw3xbt92Fg96Z-DGgPQvYxyDFwRuO1VDKyrJIkCRCwRoDa_T22YIwOr_NGP7Ht2GIFziBgbIsjkYDqzN-ABOv21o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