aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-04-22 22:25:37 +0000
committerDouglas Gregor <dgregor@apple.com>2011-04-22 22:25:37 +0000
commit788440378c442562497c09610939cbe6218ab43d (patch)
tree52f680b7a10d2c59d34d5c5aebcd12320b8a049b /lib/Sema/SemaDeclCXX.cpp
parent8387e2a41eef6fa17fb140a18c29b6eee9dd2b8a (diff)
At the end of the translation unit, defining a vtable can introduce
new templates that need to be instantiated and vice-versa. Iterate until we've instantiated all required templates and defined all required vtables. Fixed PR9325 / <rdar://problem/9055177>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@130023 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 5f3f600c8c..3a87cfd966 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -7751,6 +7751,7 @@ bool Sema::DefineUsedVTables() {
// the members of a class as "used", so we check the size each
// time through the loop and prefer indices (with are stable) to
// iterators (which are not).
+ bool DefinedAnything = false;
for (unsigned I = 0; I != VTableUses.size(); ++I) {
CXXRecordDecl *Class = VTableUses[I].first->getDefinition();
if (!Class)
@@ -7803,6 +7804,7 @@ bool Sema::DefineUsedVTables() {
// Mark all of the virtual members of this class as referenced, so
// that we can build a vtable. Then, tell the AST consumer that a
// vtable for this class is required.
+ DefinedAnything = true;
MarkVirtualMembersReferenced(Loc, Class);
CXXRecordDecl *Canonical = cast<CXXRecordDecl>(Class->getCanonicalDecl());
Consumer.HandleVTable(Class, VTablesUsed[Canonical]);
@@ -7816,7 +7818,7 @@ bool Sema::DefineUsedVTables() {
}
VTableUses.clear();
- return true;
+ return DefinedAnything;
}
void Sema::MarkVirtualMembersReferenced(SourceLocation Loc,