You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assertion failed: ((Record->hasTrivialCopyConstructor() || Record->hasTrivialCopyAssignment() || Record->hasTrivialMoveConstructor() || Record->hasTrivialMoveAssignment() || Record->isUnion()) && "Trying to aggregate-copy a type without a trivial copy/move " "constructor or assignment operator"), function EmitAggregateCopy, file /usr/src/llvm/clang/lib/CodeGen/CGExprAgg.cpp, line 1928.
(lldb) bt
thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
This was fixed by Arthur in c8227f06b335 . Can we still merge this to 12.0.1, as it is a quite trivial fix? It would be nice to build Chromium without asserting. :)
Extended Description
I think the fix may be to just change the assert in EmitAggregateCopy, as memcpying a trivial_abi return value should work.
Test case:
struct A {
A(A &);
A &operator=(const A &);
} attribute((trivial_abi));
A (*f)() = -> A {};
$ clang -cc1 -triple x86_64-apple-macosx10.14.0 -S test.cpp
Assertion failed: ((Record->hasTrivialCopyConstructor() || Record->hasTrivialCopyAssignment() || Record->hasTrivialMoveConstructor() || Record->hasTrivialMoveAssignment() || Record->isUnion()) && "Trying to aggregate-copy a type without a trivial copy/move " "constructor or assignment operator"), function EmitAggregateCopy, file /usr/src/llvm/clang/lib/CodeGen/CGExprAgg.cpp, line 1928.
(lldb) bt
__pthread_kill + 10 frame #​1: 0x00007fff77d68bf1 libsystem_pthread.dylib
pthread_kill + 284frame #2: 0x00007fff77c176a6 libsystem_c.dylib
abort + 127 frame #​3: 0x00007fff77be020d libsystem_c.dylib
__assert_rtn + 324frame #4: 0x000000010bdfc13b libclangCodeGen.dylib
clang::CodeGen::CodeGenFunction::EmitAggregateCopy(this=0x00007ffeefbf84a8, Dest=LValue @ 0x00007ffeefbf76b0, Src=LValue @ 0x00007ffeefbf7710, Ty=QualType @ 0x00007ffeefbf7698, MayOverlap=DoesNotOverlap, isVolatile=false) at CGExprAgg.cpp:1922:7 frame #​5: 0x000000010c03dd03 libclangCodeGen.dylib
clang::CodeGen::CodeGenFunction::EmitReturnOfRValue(this=0x00007ffeefbf84a8, RV=RValue @ 0x00007ffeefbf7a40, Ty=QualType @ 0x00007ffeefbf7a38) at CGStmt.cpp:1031:5frame #6: 0x000000010bcca97a libclangCodeGen.dylib
clang::CodeGen::CodeGenFunction::EmitForwardingCallToLambda(this=0x00007ffeefbf84a8, callOperator=0x0000000124057a20, callArgs=0x00007ffeefbf7cc8) at CGClass.cpp:2855:5 frame #​7: 0x000000010bccb05d libclangCodeGen.dylib
clang::CodeGen::CodeGenFunction::EmitLambdaDelegatingInvokeBody(this=0x00007ffeefbf84a8, MD=0x0000000124057cc8) at CGClass.cpp:2917:3frame #8: 0x000000010bccb1db libclangCodeGen.dylib
clang::CodeGen::CodeGenFunction::EmitLambdaStaticInvokeBody(this=0x00007ffeefbf84a8, MD=0x0000000124057cc8) at CGClass.cpp:2928:3 frame #​9: 0x000000010c0d9179 libclangCodeGen.dylib
clang::CodeGen::CodeGenFunction::GenerateCode(this=0x00007ffeefbf84a8, GD=GlobalDecl @ 0x00007ffeefbf83b0, Fn=0x0000000122404aa8, FnInfo=0x00000001224037c0) at CodeGenFunction.cpp:1193:5The text was updated successfully, but these errors were encountered: