<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/70191>70191</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang][clang::Sema] `clang::OverloadCandidateSet::NoteCandidates` crash
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
clang:frontend
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
VitaNuo
</td>
</tr>
</table>
<pre>
## Steps to reproduce
### Code snippet
```
typedef a;
using b = char *;
template <typename... c> void d(c...) = d<b, a>("", "")
```
### Command
`clang -fsyntax-only snippet.cc`
### Compiler
```
clang version 18.0.0 (git@github.com:llvm/llvm-project.git 513fe12e43d511987230105b8b61beb7bab08a73)
Target: x86_64-unknown-linux-gnu
Thread model: posix
```
## Crash stack trace
```
#0 0x0000556bdff1bc93 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /usr/local/google/home/bakalova/llvm-project/llvm/lib/Support/Unix/Sig
nals.inc:723:13
#1 0x0000556bdff1987e llvm::sys::RunSignalHandlers() /usr/local/google/home/bakalova/llvm-project/llvm/lib/Support/Signals.cpp:106:18
#2 0x0000556bdfe8d518 HandleCrash /usr/local/google/home/bakalova/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:73:5
#3 0x0000556bdfe8d518 CrashRecoverySignalHandler(int) /usr/local/google/home/bakalova/llvm-project/llvm/lib/Support/CrashRecoveryContext.cpp:390
:51
#4 0x00007f728285a510 (/lib/x86_64-linux-gnu/libc.so.6+0x3c510)
#5 0x00007f72828a80fc __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#6 0x00007f728285a472 raise ./signal/../sysdeps/posix/raise.c:27:6
#7 0x00007f72828444b2 abort ./stdlib/abort.c:81:7
#8 0x00007f72828443d5 _nl_load_domain ./intl/loadmsgcat.c:1177:9
#9 0x00007f72828533a2 (/lib/x86_64-linux-gnu/libc.so.6+0x353a2)
#10 0x0000556be283646a DiagnoseBadConversion(clang::Sema&, clang::OverloadCandidate*, unsigned int, bool) /usr/local/google/home/bakalova/llvm-pr
oject/clang/lib/Sema/SemaOverload.cpp:10832:5
#11 0x0000556be2805dc1 NoteFunctionCandidate /usr/local/google/home/bakalova/llvm-project/clang/lib/Sema/SemaOverload.cpp:0:16
#12 0x0000556be2805dc1 clang::OverloadCandidateSet::NoteCandidates(clang::Sema&, llvm::ArrayRef<clang::Expr*>, llvm::ArrayRef<clang::OverloadCand
idate*>, llvm::StringRef, clang::SourceLocation) /usr/local/google/home/bakalova/llvm-project/clang/lib/Sema/SemaOverload.cpp:12126:7
#13 0x0000556be281beb9 clang::OverloadCandidateSet::NoteCandidates(std::pair<clang::SourceLocation, clang::PartialDiagnostic>, clang::Sema&, clan
g::OverloadCandidateDisplayKind, llvm::ArrayRef<clang::Expr*>, llvm::StringRef, clang::SourceLocation, llvm::function_ref<bool (clang::OverloadCa
ndidate&)>) /usr/local/google/home/bakalova/llvm-project/clang/lib/Sema/SemaOverload.cpp:12104:11
#14 0x0000556be2822900 FinishOverloadedCallExpr(clang::Sema&, clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, l
lvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, clang::OverloadCandidateSet*, clang::OverloadCandidate**, clang::Overloa
dingResult, bool) /usr/local/google/home/bakalova/llvm-project/clang/lib/Sema/SemaOverload.cpp:13589:19
#15 0x0000556be282218c clang::Sema::BuildOverloadedCallExpr(clang::Scope*, clang::Expr*, clang::UnresolvedLookupExpr*, clang::SourceLocation, llv
m::MutableArrayRef<clang::Expr*>, clang::SourceLocation, clang::Expr*, bool, bool) /usr/local/google/home/bakalova/llvm-project/clang/lib/Sema/Se
maOverload.cpp:13672:10
#16 0x0000556be2464365 clang::Sema::BuildCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang:
:SourceLocation, clang::Expr*, bool, bool) /usr/local/google/home/bakalova/llvm-project/clang/lib/Sema/SemaExpr.cpp:7207:16
#17 0x0000556be248042b clang::Sema::ActOnCallExpr(clang::Scope*, clang::Expr*, clang::SourceLocation, llvm::MutableArrayRef<clang::Expr*>, clang:
:SourceLocation, clang::Expr*) /usr/local/google/home/bakalova/llvm-project/clang/lib/Sema/SemaExpr.cpp:7098:7
#18 0x0000556be20733c9 clang::Parser::ParsePostfixExpressionSuffix(clang::ActionResult<clang::Expr*, true>) /usr/local/google/home/bakalova/llvm-
project/clang/lib/Parse/ParseExpr.cpp:2134:23
#19 0x0000556be20744da clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) /
usr/local/google/home/bakalova/llvm-project/clang/lib/Parse/ParseExpr.cpp:1861:7
#20 0x0000556be20770f3 clang::Parser::ParseCastExpression(clang::Parser::CastParseKind, bool, bool&, clang::Parser::TypeCastState, bool, bool*) /
usr/local/google/home/bakalova/llvm-project/clang/lib/Parse/ParseExpr.cpp:0:0
#21 0x0000556be20703f4 ParseCastExpression /usr/local/google/home/bakalova/llvm-project/clang/lib/Parse/ParseExpr.cpp:684:20
#22 0x0000556be20703f4 clang::Parser::ParseAssignmentExpression(clang::Parser::TypeCastState) /usr/local/google/home/bakalova/llvm-project/clang/
lib/Parse/ParseExpr.cpp:176:20
#23 0x0000556be20397ad ParseInitializer /usr/local/google/home/bakalova/llvm-project/clang/include/clang/Parse/Parser.h:0:0
#24 0x0000556be20397ad clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&,
clang::Parser::ForRangeInit*) /usr/local/google/home/bakalova/llvm-project/clang/lib/Parse/ParseDecl.cpp:2604:25
#25 0x0000556be2039ccf clang::Parser::ParseDeclarationAfterDeclarator(clang::Declarator&, clang::Parser::ParsedTemplateInfo const&) /usr/local/go
ogle/home/bakalova/llvm-project/clang/lib/Parse/ParseDecl.cpp:2462:1
#26 0x0000556be20f1c4c clang::Parser::ParseSingleDeclarationAfterTemplate(clang::DeclaratorContext, clang::Parser::ParsedTemplateInfo const&, clang::ParsingDeclRAIIObject&, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) /usr/local/google/home/bakalova/llvm-project/clang/lib/Parse/ParseTemplate.cpp:366:20
#27 0x0000556be20f0567 clang::Parser::ParseTemplateDeclarationOrSpecialization(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) /usr/local/google/home/bakalova/llvm-project/clang/lib/Parse/ParseTemplate.cpp:0:0
#28 0x0000556be20efe45 clang::Parser::ParseDeclarationStartingWithTemplate(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::AccessSpecifier) /usr/local/google/home/bakalova/llvm-project/clang/lib/Parse/ParseTemplate.cpp:0:0
#29 0x0000556be2035591 clang::Parser::ParseDeclaration(clang::DeclaratorContext, clang::SourceLocation&, clang::ParsedAttributes&, clang::ParsedA
ttributes&, clang::SourceLocation*) /usr/local/google/home/bakalova/llvm-project/clang/lib/Parse/ParseDecl.cpp:1960:10
#30 0x0000556be2016520 clang::Parser::ParseExternalDeclaration(clang::ParsedAttributes&, clang::ParsedAttributes&, clang::ParsingDeclSpec*) /usr/
local/google/home/bakalova/llvm-project/clang/lib/Parse/Parser.cpp:0:3
#31 0x0000556be2014889 clang::Parser::ParseTopLevelDecl(clang::OpaquePtr<clang::DeclGroupRef>&, clang::Sema::ModuleImportState&) /usr/local/googl
e/home/bakalova/llvm-project/clang/lib/Parse/Parser.cpp:0:12
#32 0x0000556be200f1de clang::ParseAST(clang::Sema&, bool, bool) /usr/local/google/home/bakalova/llvm-project/clang/lib/Parse/ParseAST.cpp:162:5
#33 0x0000556be08e2890 clang::FrontendAction::Execute() /usr/local/google/home/bakalova/llvm-project/clang/lib/Frontend/FrontendAction.cpp:1074:1
0
#34 0x0000556be08515cf getPtr /usr/local/google/home/bakalova/llvm-project/llvm/include/llvm/Support/Error.h:270:42
#35 0x0000556be08515cf operator bool /usr/local/google/home/bakalova/llvm-project/llvm/include/llvm/Support/Error.h:233:16
#36 0x0000556be08515cf clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) /usr/local/google/home/bakalova/llvm-project/clang/lib/Fron
tend/CompilerInstance.cpp:1054:23
#37 0x0000556be09bcc87 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) /usr/local/google/home/bakalova/llvm-project/clang/lib/Frontend
Tool/ExecuteCompilerInvocation.cpp:272:25
#38 0x0000556bdda47c38 cc1_main(llvm::ArrayRef<char const*>, char const*, void*) /usr/local/google/home/bakalova/llvm-project/clang/tools/driver/
cc1_main.cpp:283:15
#39 0x0000556bdda44661 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) /usr/local/google/home/bakalova/llvm-project
/clang/tools/driver/driver.cpp:0:12
#40 0x0000556be06b3ff9 operator() /usr/local/google/home/bakalova/llvm-project/clang/lib/Driver/Job.cpp:440:30
#41 0x0000556be06b3ff9 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::String
Ref>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, bool*) const::$_1>(long) /usr/local/google/home/bakalova/
llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:45:12
#42 0x0000556bdfe8d25b operator() /usr/local/google/home/bakalova/llvm-project/llvm/include/llvm/ADT/STLFunctionalExtras.h:0:12
#43 0x0000556bdfe8d25b llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) /usr/local/google/home/bakalova/llvm-project/llvm/lib/S
upport/CrashRecoveryContext.cpp:426:3
#44 0x0000556be06b3540 clang::driver::CC1Command::Execute(llvm::ArrayRef<std::optional<llvm::StringRef>>, std::__cxx11::basic_string<char, std::c
har_traits<char>, std::allocator<char>>*, bool*) const /usr/local/google/home/bakalova/llvm-project/clang/lib/Driver/Job.cpp:440:7
#45 0x0000556be0673318 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const /usr
/local/google/home/bakalova/llvm-project/clang/lib/Driver/Compilation.cpp:199:15
#46 0x0000556be06735d7 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver:
:Command const*>>&, bool) const /usr/local/google/home/bakalova/llvm-project/clang/lib/Driver/Compilation.cpp:253:13
#47 0x0000556be0693ab7 empty /usr/local/google/home/bakalova/llvm-project/llvm/include/llvm/ADT/SmallVector.h:94:46
#48 0x0000556be0693ab7 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver:
:Command const*>>&) /usr/local/google/home/bakalova/llvm-project/clang/lib/Driver/Driver.cpp:1883:23
#49 0x0000556bdda438fe clang_main(int, char**, llvm::ToolContext const&) /usr/local/google/home/bakalova/llvm-project/clang/tools/driver/driver.c
pp:542:21
#50 0x0000556bdda53f91 main /usr/local/google/home/bakalova/llvm-project/build/tools/clang/tools/driver/clang-driver.cpp:15:3
#51 0x00007f72828456ca __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#52 0x00007f7282845785 call_init ./csu/../csu/libc-start.c:128:20
#53 0x00007f7282845785 __libc_start_main ./csu/../csu/libc-start.c:347:5
#54 0x0000556bdda40a51 _start (/usr/local/google/home/bakalova/llvm-project/build/bin/clang+0x10bfa51)
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzsW19zozgS_zTkhYoLJMSfhzx4nPhu9mZ3psbZvUeXEMLRDZY4IbLOfforCbCFjD2ejJO6rbqp1BiD1Or-dau71bRx07ANp_TOQx88dH-DW_Uk5N0fTOHfWnGTi-LlzgPQA9BfKVo3vhK-pLUURUuoF9x7wbx7rEcsREH9hrO6pqp_Fgf9n_mqXmpa0NLHHvzQ3Wkbxjd-7nvw3idPWPoemO8fKrqtK6yo78GFnsrxls5mM5948MF_FqzwCw-kZDabe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