Open Quuxplusone opened 11 years ago
Attached clang_crash.tar.gz
(1891 bytes, application/gzip): the code and the requested compilation output
Simplified a bit:
struct Move2;
struct Foo
{
Foo(const Move2&);
// NON-CONST ARGS. CLANG DOES NOT CRASH AND REPORTS PROPER DIAGNOSTICS WHEN THEY ARE CONST
Foo(Foo&);
};
struct Move2 {
Move2(Foo f);
};
Foo func();
int main() {
Foo f = func();
}
The compiler ends up infinitely recursing through these stack frames:
#396 0x0000000002357d0d in PerformConstructorInitialization (S=..., Entity=...,
Kind=..., Args=..., Step=..., ConstructorInitRequiresZeroInit=@0x7fffff8ed89f:
false, IsListInitialization=false) at .../tools/clang/lib/Sema/SemaInit.cpp:5062
#397 0x0000000002352580 in clang::InitializationSequence::Perform
(this=0x7fffff8edae8, S=..., Entity=..., Kind=..., Args=..., ResultType=0x0) at
.../tools/clang/lib/Sema/SemaInit.cpp:5824
#398 0x0000000002358aa2 in clang::Sema::PerformCopyInitialization
(this=0x486c750, Entity=..., EqualLoc=..., Init=..., TopLevelOfInitList=false,
AllowExplicit=false) at .../tools/clang/lib/Sema/SemaInit.cpp:6928
#399 0x0000000002252a4a in clang::Sema::GatherArgumentsForCall (this=0x486c750,
CallLoc=..., FDecl=0x4889500, Proto=0x48894a0, FirstProtoArg=0, Args=...,
AllArgs=..., CallType=clang::Sema::VariadicDoesNotApply, AllowExplicit=false,
IsList
Initialization=false) at .../tools/clang/lib/Sema/SemaExpr.cpp:3960
#400 0x00000000021c05f8 in clang::Sema::CompleteConstructorCall
(this=0x486c750, Constructor=0x4889500, ArgsPtr=..., Loc=...,
ConvertedArgs=..., AllowExplicit=false, IsListInitialization=false) at
.../tools/clang/lib/Sema/SemaDeclCXX.cpp:10102
clang_crash.tar.gz
(1891 bytes, application/gzip)