<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/63341>63341</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang crash when compiling programs
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kissholic
</td>
</tr>
</table>
<pre>
Source code:
``` c++
template<int N>
void f(const char (*s)[([]{}, N)]) {}
int main() {
auto x = f<10>;
return 0;
}
```
Compilation command:
clang++ code.cpp -g --std=c++17
Stack dump:
0. Program arguments: /usr/bin/clang-15 -cc1 -triple x86_64-pc-linux-gnu -emit-obj -mrelax-all --mrelax-relocations -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name code.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -mllvm -treat-scalable-fixed-error-as-warning -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb -fcoverage-compilation-dir=/root -resource-dir /usr/lib/clang/15.0.7 -internal-isystem /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1 -internal-isystem /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/x86_64-pc-linux-gnu -internal-isystem /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../include/c++/13.1.1/backward -internal-isystem /usr/lib/clang/15.0.7/include -internal-isystem /usr/local/include -internal-isystem /usr/sbin/../lib64/gcc/x86_64-pc-linux-gnu/13.1.1/../../../../x86_64-pc-linux-gnu/include -internal-externc-isystem /include -internal-externc-isystem /usr/include --std=c++17 -fdeprecated-macro -fdebug-compilation-dir=/root -ferror-limit 19 -stack-protector 2 -fgnuc-version=4.2.1 -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/code-ea0496.o -x c++ code.cpp
1. <eof> parser at end of file
2. code.cpp:5:5: LLVM IR generation of declaration 'main'
3. code.cpp:5:5: Generating code for declaration 'main'
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):
/usr/lib/libLLVM-15.so(+0xd7baaa)[0x7f9319dabaaa]
/usr/lib/libLLVM-15.so(_ZN4llvm3sys17RunSignalHandlersEv+0x2f)[0x7f9319da913f]
/usr/lib/libLLVM-15.so(+0xd7928d)[0x7f9319da928d]
/usr/lib/libc.so.6(+0x38a40)[0x7f9318c08a40]
/usr/lib/libLLVM-15.so(_ZNK4llvm4Type11isIntegerTyEj+0x6)[0x7f9319f8a716]
/usr/lib/libclang-cpp.so.15(+0x25671f6)[0x7f9322e571f6]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen12CodeGenTypes11ConvertTypeENS_8QualTypeE+0x322)[0x7f93221806e2]
/usr/lib/libclang-cpp.so.15(+0x18e9813)[0x7f93221d9813]
/usr/lib/libclang-cpp.so.15(+0x18edfd5)[0x7f93221ddfd5]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen12CodeGenTypes23arrangeLLVMFunctionInfoENS_7CanQualINS_4TypeEEEbbN4llvm8ArrayRefIS4_EENS_12FunctionType7ExtInfoENS6_INS8_16ExtParameterInfoEEENS0_12RequiredArgsE+0x461)[0x7f9321eeb271]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen12CodeGenTypes23arrangeFreeFunctionTypeENS_7CanQualINS_17FunctionProtoTypeEEE+0xe0)[0x7f9321eecf70]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen12CodeGenTypes27ConvertFunctionTypeInternalENS_8QualTypeE+0x111)[0x7f9322180311]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen12CodeGenTypes11ConvertTypeENS_8QualTypeE+0x728)[0x7f9322180ae8]
/usr/lib/libclang-cpp.so.15(+0x2567170)[0x7f9322e57170]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen12CodeGenTypes11ConvertTypeENS_8QualTypeE+0x322)[0x7f93221806e2]
/usr/lib/libclang-cpp.so.15(+0x2567170)[0x7f9322e57170]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen15CodeGenFunction17EmitAutoVarAllocaERKNS_7VarDeclE+0x4f5)[0x7f9321f76e85]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen15CodeGenFunction15EmitAutoVarDeclERKNS_7VarDeclE+0x2e)[0x7f9321f7c87e]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen15CodeGenFunction8EmitDeclERKNS_4DeclE+0x82)[0x7f9321f7ca82]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen15CodeGenFunction12EmitDeclStmtERKNS_8DeclStmtE+0x87)[0x7f93220b1037]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen15CodeGenFunction14EmitSimpleStmtEPKNS_4StmtEN4llvm8ArrayRefIPKNS_4AttrEEE+0xfd)[0x7f93220d1bad]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen15CodeGenFunction8EmitStmtEPKNS_4StmtEN4llvm8ArrayRefIPKNS_4AttrEEE+0x52)[0x7f93220ccb82]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen15CodeGenFunction28EmitCompoundStmtWithoutScopeERKNS_12CompoundStmtEbNS0_12AggValueSlotE+0x89)[0x7f93220cdbe9]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen15CodeGenFunction16EmitFunctionBodyEPKNS_4StmtE+0x82)[0x7f9322114402]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen15CodeGenFunction12GenerateCodeENS_10GlobalDeclEPN4llvm8FunctionERKNS0_14CGFunctionInfoE+0x2ae)[0x7f932211491e]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen13CodeGenModule28EmitGlobalFunctionDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE+0x19f)[0x7f93221560af]
/usr/lib/libclang-cpp.so.15(_ZN5clang7CodeGen13CodeGenModule20EmitGlobalDefinitionENS_10GlobalDeclEPN4llvm11GlobalValueE+0x274)[0x7f9322153a74]
/usr/lib/libclang-cpp.so.15(+0x186b88f)[0x7f932215b88f]
/usr/lib/libclang-cpp.so.15(+0x18d0ef9)[0x7f93221c0ef9]
/usr/lib/libclang-cpp.so.15(+0x17ebe98)[0x7f93220dbe98]
/usr/lib/libclang-cpp.so.15(_ZN5clang8ParseASTERNS_4SemaEbb+0x243)[0x7f932113c3b3]
/usr/lib/libclang-cpp.so.15(_ZN5clang14FrontendAction7ExecuteEv+0x189)[0x7f93227b8789]
/usr/lib/libclang-cpp.so.15(_ZN5clang16CompilerInstance13ExecuteActionERNS_14FrontendActionE+0x18f)[0x7f932275c7ff]
/usr/lib/libclang-cpp.so.15(_ZN5clang25ExecuteCompilerInvocationEPNS_16CompilerInstanceE+0x1ba)[0x7f932281d59a]
/usr/bin/clang-15(_Z8cc1_mainN4llvm8ArrayRefIPKcEES2_Pv+0xea7)[0x7f9323a7a027]
/usr/bin/clang-15(+0x16da7)[0x7f9323a7dda7]
/usr/bin/clang-15(_Z10clang_mainiPPc+0x5d0)[0x7f9323a7e630]
/usr/lib/libc.so.6(+0x232d0)[0x7f9318bf32d0]
/usr/lib/libc.so.6(__libc_start_main+0x8a)[0x7f9318bf338a]
/usr/bin/clang-15(_start+0x25)[0x7f9323a73ea5]
clang-15: error: unable to execute command: Segmentation fault (core dumped)
clang-15: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 15.0.7
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/sbin
clang-15: note: diagnostic msg:
********************
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMWV9z4ygS_zTKC4VLIFuSH_Lg8Z_Z1O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