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:
Eli Friedman 2009-12-02 06:59:20 +00:00
parent 53ad6b94b0
commit 81bce6b05e
2 changed files with 11 additions and 0 deletions

View File

@ -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()) {

View 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_