From: Anders Carlsson Date: Tue, 25 Jan 2011 18:08:22 +0000 (+0000) Subject: Don't insert class templates into the DynamicClasses vector. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a5c6c2a84cde5c9b8f8ec0610a9f89ffd54f44ee;p=clang Don't insert class templates into the DynamicClasses vector. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@124201 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/Sema.cpp b/lib/Sema/Sema.cpp index ca69d69959..60cfd47e0f 100644 --- a/lib/Sema/Sema.cpp +++ b/lib/Sema/Sema.cpp @@ -290,6 +290,8 @@ void Sema::ActOnEndOfTranslationUnit() { // this translation unit, then those vtables are considered "used" and must // be emitted. for (unsigned I = 0, N = DynamicClasses.size(); I != N; ++I) { + assert(!DynamicClasses[I]->isDependentType() && + "Should not see dependent types here!"); if (const CXXMethodDecl *KeyFunction = Context.getKeyFunction(DynamicClasses[I])) { const FunctionDecl *Definition = 0; diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 25d0a5effe..d5dea78230 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -2746,7 +2746,7 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) { } } - if (Record->isDynamicClass()) + if (Record->isDynamicClass() && !Record->isDependentType()) DynamicClasses.push_back(Record); if (Record->getIdentifier()) {