From: Anders Carlsson Date: Sat, 30 Jan 2010 17:42:34 +0000 (+0000) Subject: Add an assert to make sure that we don't try to mess with overridden methods for... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c076c450e4fdc7be27c8541b273451f28345044a;p=clang Add an assert to make sure that we don't try to mess with overridden methods for class templates. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94907 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp index fe6064df32..73f47d9bc0 100644 --- a/lib/AST/DeclCXX.cpp +++ b/lib/AST/DeclCXX.cpp @@ -604,7 +604,9 @@ static OverriddenMethodsMapTy *OverriddenMethods = 0; void CXXMethodDecl::addOverriddenMethod(const CXXMethodDecl *MD) { assert(MD->isCanonicalDecl() && "Method is not canonical!"); - + assert(!MD->getParent()->isDependentContext() && + "Can't add an overridden method to a class template!"); + // FIXME: The CXXMethodDecl dtor needs to remove and free the entry. if (!OverriddenMethods)