mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-26 23:56:06 +00:00
Make sure to call AddOverriddenMethods for implicit copy assignment operators;
it's rare, but possible, for the difference to be significant. llvm-svn: 90301
This commit is contained in:
parent
53ad6b94b0
commit
81bce6b05e
@ -2149,6 +2149,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) {
|
||||
// Don't call addedAssignmentOperator. There is no way to distinguish an
|
||||
// implicit from an explicit assignment operator.
|
||||
ClassDecl->addDecl(CopyAssignment);
|
||||
AddOverriddenMethods(ClassDecl, CopyAssignment);
|
||||
}
|
||||
|
||||
if (!ClassDecl->hasUserDeclaredDestructor()) {
|
||||
|
10
clang/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp
Normal file
10
clang/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp
Normal file
@ -0,0 +1,10 @@
|
||||
// RUN: clang-cc -emit-llvm -o - %s | FileCheck %s
|
||||
|
||||
struct D;
|
||||
struct B {
|
||||
virtual D& operator = (const D&);
|
||||
};
|
||||
struct D : B { D(); virtual void a(); };
|
||||
void D::a() {}
|
||||
|
||||
// CHECK: @_ZTV1D = {{.*}} @_ZN1DaSERKS_
|
Loading…
x
Reference in New Issue
Block a user