| Issue |
113763
|
| Summary |
[clang] clang trunk crashed at clang::Sema::DefaultArgumentPromotion(clang::Expr*)
|
| Labels |
clang:frontend,
crash-on-invalid,
regression:16,
clang:frontend:fuzzer
|
| Assignees |
|
| Reporter |
yijan4845
|
**This testcase is generated by a fuzzer.**
Compiler Explorer: [https://godbolt.org/z/36nhWEY5v](https://godbolt.org/z/36nhWEY5v)
This invalid code will crash on Clang Trunk.
```cpp
template<typename T> struct A {
template<typename U> struct B {
B(...);
B(const B & = ;) = default;
};
template<typename U> B(U) -> B<U>;
};
A<void>::B b = 123;
A<void>::B copy = b;
```
This goes back to clang-16. The stack dump seems to be similar with [102106](https://github.com/llvm/llvm-project/issues/102106) and [27228](https://github.com/llvm/llvm-project/issues/27228) and I believe that these two are the same issue.
Stack dump:
```
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: /opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20 -cc1 -triple x86_64-unknown-linux-gnu -emit-obj -dumpdir /app/output.s- -disable-free -clear-ast-before-backend -main-file-name example.cpp -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=all -fmath-errno -ffp-contract=on -fno-rounding-math -fno-verbose-asm -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -tune-cpu generic -debug-info-kind=constructor -dwarf-version=4 -debugger-tuning=gdb -fdebug-compilation-dir=/app -fcoverage-compilation-dir=/app -resource-dir /opt/compiler-explorer/clang-assertions-trunk-20241024/lib/clang/20 -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0 -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/x86_64-linux-gnu -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../include/c++/15.0.0/backward -internal-isystem /opt/compiler-explorer/clang-assertions-trunk-20241024/lib/clang/20/include -internal-isystem /usr/local/include -internal-isystem /opt/compiler-explorer/gcc-snapshot/lib/gcc/x86_64-linux-gnu/15.0.0/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -fdeprecated-macro -ferror-limit 19 -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcxx-exceptions -fexceptions -fcolor-diagnostics -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -o /tmp/example-cb2afb.o -x c++ <source>
1. <source>:9:20: current parser token ';'
#0 0x0000000003bd1a88 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x3bd1a88)
#1 0x0000000003bcf43c SignalHandler(int) Signals.cpp:0:0
#2 0x00007b0ff7842520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#3 0x0000000006efc3cb clang::Sema::PerformCopyInitialization(clang::InitializedEntity const&, clang::SourceLocation, clang::ActionResult<clang::Expr*, true>, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6efc3cb)
#4 0x0000000006ca3bf8 clang::Sema::DefaultArgumentPromotion(clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6ca3bf8)
#5 0x0000000006cb36b8 clang::Sema::DefaultVariadicArgumentPromotion(clang::Expr*, clang::Sema::VariadicCallType, clang::FunctionDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6cb36b8)
#6 0x0000000006cb43e2 clang::Sema::GatherArgumentsForCall(clang::SourceLocation, clang::FunctionDecl*, clang::FunctionProtoType const*, unsigned int, llvm::ArrayRef<clang::Expr*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::Sema::VariadicCallType, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6cb43e2)
#7 0x0000000006aec996 clang::Sema::CompleteConstructorCall(clang::CXXConstructorDecl*, clang::QualType, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, llvm::SmallVectorImpl<clang::Expr*>&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6aec996)
#8 0x0000000006edfcb9 PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#9 0x0000000006eeed2a clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6eeed2a)
#10 0x0000000006efc472 clang::Sema::PerformCopyInitialization(clang::InitializedEntity const&, clang::SourceLocation, clang::ActionResult<clang::Expr*, true>, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6efc472)
#11 0x0000000006ca3bf8 clang::Sema::DefaultArgumentPromotion(clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6ca3bf8)
#12 0x0000000006cb36b8 clang::Sema::DefaultVariadicArgumentPromotion(clang::Expr*, clang::Sema::VariadicCallType, clang::FunctionDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6cb36b8)
#13 0x0000000006cb43e2 clang::Sema::GatherArgumentsForCall(clang::SourceLocation, clang::FunctionDecl*, clang::FunctionProtoType const*, unsigned int, llvm::ArrayRef<clang::Expr*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::Sema::VariadicCallType, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6cb43e2)
#14 0x0000000006aec996 clang::Sema::CompleteConstructorCall(clang::CXXConstructorDecl*, clang::QualType, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, llvm::SmallVectorImpl<clang::Expr*>&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6aec996)
#15 0x0000000006edfcb9 PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
#16 0x0000000006eeed2a clang::InitializationSequence::Perform(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::QualType*) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6eeed2a)
#17 0x0000000006efc472 clang::Sema::PerformCopyInitialization(clang::InitializedEntity const&, clang::SourceLocation, clang::ActionResult<clang::Expr*, true>, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6efc472)
#18 0x0000000006ca3bf8 clang::Sema::DefaultArgumentPromotion(clang::Expr*) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6ca3bf8)
#19 0x0000000006cb36b8 clang::Sema::DefaultVariadicArgumentPromotion(clang::Expr*, clang::Sema::VariadicCallType, clang::FunctionDecl*) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6cb36b8)
#20 0x0000000006cb43e2 clang::Sema::GatherArgumentsForCall(clang::SourceLocation, clang::FunctionDecl*, clang::FunctionProtoType const*, unsigned int, llvm::ArrayRef<clang::Expr*>, llvm::SmallVectorImpl<clang::Expr*>&, clang::Sema::VariadicCallType, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6cb43e2)
#21 0x0000000006aec996 clang::Sema::CompleteConstructorCall(clang::CXXConstructorDecl*, clang::QualType, llvm::MutableArrayRef<clang::Expr*>, clang::SourceLocation, llvm::SmallVectorImpl<clang::Expr*>&, bool, bool) (/opt/compiler-explorer/clang-assertions-trunk-20241024/bin/clang-20+0x6aec996)
#22 0x0000000006edfcb9 PerformConstructorInitialization(clang::Sema&, clang::InitializedEntity const&, clang::InitializationKind const&, llvm::MutableArrayRef<clang::Expr*>, clang::InitializationSequence::Step const&, bool&, bool, bool, clang::SourceLocation, clang::SourceLocation) SemaInit.cpp:0:0
... (loop)
clang++: error: unable to execute command: Segmentation fault (core dumped)
clang++: error: clang frontend command failed due to signal (use -v to see invocation)
Execution build compiler returned: 254
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs