]> granicus.if.org Git - clang/commitdiff
Add an assert to make sure that we don't try to mess with overridden methods for...
authorAnders Carlsson <andersca@mac.com>
Sat, 30 Jan 2010 17:42:34 +0000 (17:42 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 30 Jan 2010 17:42:34 +0000 (17:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@94907 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclCXX.cpp

index fe6064df325a5190fedcb50e65c2b2ff62861455..73f47d9bc06815dfa576388d01d8c7cbbe85e3d1 100644 (file)
@@ -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)