[cfe-commits] r90301 - in /cfe/trunk: lib/Sema/SemaDeclCXX.cpp test/CodeGenCXX/virtual-implicit-copy-assignment.cpp
Eli Friedman
eli.friedman at gmail.com
Tue Dec 1 22:59:20 PST 2009
Author: efriedma
Date: Wed Dec 2 00:59:20 2009
New Revision: 90301
URL: http://llvm.org/viewvc/llvm-project?rev=90301&view=rev
Log:
Make sure to call AddOverriddenMethods for implicit copy assignment operators;
it's rare, but possible, for the difference to be significant.
Added:
cfe/trunk/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp
Modified:
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=90301&r1=90300&r2=90301&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Wed Dec 2 00:59:20 2009
@@ -2149,6 +2149,7 @@
// 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()) {
Added: cfe/trunk/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp?rev=90301&view=auto
==============================================================================
--- cfe/trunk/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp (added)
+++ cfe/trunk/test/CodeGenCXX/virtual-implicit-copy-assignment.cpp Wed Dec 2 00:59:20 2009
@@ -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_
More information about the cfe-commits
mailing list