<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Clang crash in SubstituteExplicitTemplateArguments"
href="https://bugs.llvm.org/show_bug.cgi?id=49894">49894</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Clang crash in SubstituteExplicitTemplateArguments
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>-New Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>ebrown255@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Clang crashes in SubstituteExplicitTemplateArguments from this code:
<a href="https://godbolt.org/z/orbGf1ob7">https://godbolt.org/z/orbGf1ob7</a>.
Possible duplicate of 48808.
Output:
<source>:19:80: error: expected ')'
void* f(/*typename*/ RefOrValueArg<std::is_scalar<K>::value>::template type<K>
key) {
^
<source>:19:8: note: to match this '('
void* f(/*typename*/ RefOrValueArg<std::is_scalar<K>::value>::template type<K>
key) {
^
<source>:19:84: error: expected ';' at end of declaration
void* f(/*typename*/ RefOrValueArg<std::is_scalar<K>::value>::template type<K>
key) {
^
;
<source>:19:85: error: expected unqualified-id
void* f(/*typename*/ RefOrValueArg<std::is_scalar<K>::value>::template type<K>
key) {
^
<source>:26:11: error: called object type 'void *' is not a function or
function pointer
g(f<int>(a));
~~~~~~^
PLEASE submit a bug report to <a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash
backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-trunk/bin/clang++ -g -o
/app/output.s -mllvm --x86-asm-syntax=intel -S
--gcc-toolchain=/opt/compiler-explorer/gcc-snapshot -fcolor-diagnostics
-fno-crash-diagnostics <source>
1. <eof> parser at end of file
2. <source>:19:7: instantiating variable definition 'f<int>'
3. <source>:19:7: instantiating variable definition 'f<int>'
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH
or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN4llvm3sys15PrintStackTraceERNS_11raw_ostreamEi+0x2c)[0x5597daa1183c]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN4llvm3sys17RunSignalHandlersEv+0x34)[0x5597daa0f7c4]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN4llvm3sys15CleanupOnSignalEm+0xb5)[0x5597daa0fa45]
/opt/compiler-explorer/clang-trunk/bin/clang++(+0x30bd968)[0x5597da973968]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x153c0)[0x7fe1c7ad73c0]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema35SubstituteExplicitTemplateArgumentsEPNS_20FunctionTemplateDeclERNS_24TemplateArgumentListInfoERN4llvm15SmallVectorImplINS_23DeducedTemplateArgumentEEERNS6_INS_8QualTypeEEEPSA_RNS_4sema21TemplateDeductionInfoE+0x41f)[0x5597dcde3dff]
/opt/compiler-explorer/clang-trunk/bin/clang++(+0x552e7d1)[0x5597dcde47d1]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema27runWithSufficientStackSpaceENS_14SourceLocationEN4llvm12function_refIFvvEEE+0x3f)[0x5597dc7a178f]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema23DeduceTemplateArgumentsEPNS_20FunctionTemplateDeclEPNS_24TemplateArgumentListInfoENS_8QualTypeERPNS_12FunctionDeclERNS_4sema21TemplateDeductionInfoEb+0x206)[0x5597dce16c86]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema23DeduceTemplateArgumentsEPNS_20FunctionTemplateDeclEPNS_24TemplateArgumentListInfoERPNS_12FunctionDeclERNS_4sema21TemplateDeductionInfoEb+0x17)[0x5597dce17267]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema43ResolveSingleFunctionTemplateSpecializationEPNS_12OverloadExprEbPNS_14DeclAccessPairE+0x2d5)[0x5597dccd8b65]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema34ResolveAddressOfOverloadedFunctionEPNS_4ExprENS_8QualTypeEbRNS_14DeclAccessPairEPb+0xcf5)[0x5597dccddfe5]
/opt/compiler-explorer/clang-trunk/bin/clang++(+0x54294ba)[0x5597dccdf4ba]
/opt/compiler-explorer/clang-trunk/bin/clang++(+0x5430227)[0x5597dcce6227]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema21TryImplicitConversionEPNS_4ExprENS_8QualTypeEbNS0_15AllowedExplicitEbbb+0x35)[0x5597dcce6475]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang22InitializationSequence14InitializeFromERNS_4SemaERKNS_17InitializedEntityERKNS_18InitializationKindEN4llvm15MutableArrayRefIPNS_4ExprEEEbb+0xd1f)[0x5597dcba6fcf]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema20AddInitializerToDeclEPNS_4DeclEPNS_4ExprEb+0xab5)[0x5597dc902205]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema30InstantiateVariableInitializerEPNS_7VarDeclES2_RKNS_30MultiLevelTemplateArgumentListE+0x2e0)[0x5597dce78050]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema37CompleteVarTemplateSpecializationDeclEPNS_29VarTemplateSpecializationDeclEPNS_7VarDeclERKNS_30MultiLevelTemplateArgumentListE+0x6b)[0x5597dce784cb]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema29InstantiateVariableDefinitionENS_14SourceLocationEPNS_7VarDeclEbbb+0x628)[0x5597dce842c8]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema28PerformPendingInstantiationsEb+0x219)[0x5597dce84b49]
/opt/compiler-explorer/clang-trunk/bin/clang++(+0x4f03609)[0x5597dc7b9609]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang4Sema25ActOnEndOfTranslationUnitEv+0xb5)[0x5597dc7b9d15]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang6Parser17ParseTopLevelDeclERNS_9OpaquePtrINS_12DeclGroupRefEEEb+0x362)[0x5597dc6a17f2]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang8ParseASTERNS_4SemaEbb+0x229)[0x5597dc694d59]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang13CodeGenAction13ExecuteActionEv+0x32)[0x5597db8b21c2]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang14FrontendAction7ExecuteEv+0xc1)[0x5597db29eea1]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x153)[0x5597db23e233]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x813)[0x5597db367443]
/opt/compiler-explorer/clang-trunk/bin/clang++(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0x119c)[0x5597d8945abc]
/opt/compiler-explorer/clang-trunk/bin/clang++(+0x108bbcd)[0x5597d8941bcd]
/opt/compiler-explorer/clang-trunk/bin/clang++(+0x383d975)[0x5597db0f3975]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN4llvm20CrashRecoveryContext9RunSafelyENS_12function_refIFvvEEE+0x23)[0x5597da973a43]
/opt/compiler-explorer/clang-trunk/bin/clang++(+0x383e2a8)[0x5597db0f42a8]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZNK5clang6driver11Compilation14ExecuteCommandERKNS0_7CommandERPS3_+0x9a)[0x5597db0cc3ea]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZNK5clang6driver11Compilation11ExecuteJobsERKNS0_7JobListERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0x29f)[0x5597db0ccf3f]
/opt/compiler-explorer/clang-trunk/bin/clang++(_ZN5clang6driver6Driver18ExecuteCompilationERNS0_11CompilationERN4llvm15SmallVectorImplISt4pairIiPKNS0_7CommandEEEE+0xa5)[0x5597db0d5e55]
/opt/compiler-explorer/clang-trunk/bin/clang++(main+0x1814)[0x5597d885d9c4]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3)[0x7fe1c75880b3]
/opt/compiler-explorer/clang-trunk/bin/clang++(_start+0x2a)[0x5597d894172a]
clang-13: error: clang frontend command failed with exit code 139 (use -v to
see invocation)
Compiler returned: 139</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>