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 fe6064d..73f47d9 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -604,7 +604,9 @@
 
 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)