[cfe-commits] r110526 - in /cfe/trunk: lib/Sema/SemaDeclCXX.cpp test/SemaCXX/virtual-base-used.cpp
Eli Friedman
eli.friedman at gmail.com
Sat Aug 7 16:11:44 PDT 2010
Author: efriedma
Date: Sat Aug 7 18:11:44 2010
New Revision: 110526
URL: http://llvm.org/viewvc/llvm-project?rev=110526&view=rev
Log:
PR7800: both virtual and non-virtual bases must be marked as used for VTTs.
Added:
cfe/trunk/test/SemaCXX/virtual-base-used.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=110526&r1=110525&r2=110526&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sat Aug 7 18:11:44 2010
@@ -6797,8 +6797,6 @@
e = RD->bases_end(); i != e; ++i) {
const CXXRecordDecl *Base =
cast<CXXRecordDecl>(i->getType()->getAs<RecordType>()->getDecl());
- if (i->isVirtual())
- continue;
if (Base->getNumVBases() == 0)
continue;
MarkVirtualMembersReferenced(Loc, Base);
Added: cfe/trunk/test/SemaCXX/virtual-base-used.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/virtual-base-used.cpp?rev=110526&view=auto
==============================================================================
--- cfe/trunk/test/SemaCXX/virtual-base-used.cpp (added)
+++ cfe/trunk/test/SemaCXX/virtual-base-used.cpp Sat Aug 7 18:11:44 2010
@@ -0,0 +1,16 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+// PR7800
+
+class NoDestroy { ~NoDestroy(); }; // expected-note {{declared private here}}
+struct A {
+ virtual ~A();
+};
+struct B : public virtual A {
+ NoDestroy x; // expected-error {{field of type 'NoDestroy' has private destructor}}
+};
+struct D : public virtual B {
+ virtual void foo();
+ ~D();
+};
+void D::foo() { // expected-note {{implicit default destructor for 'B' first required here}}
+}
More information about the cfe-commits
mailing list