Fix PR9941 again, this time for templates.

llvm-svn: 131640
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index fd28f2b..fcff0b8 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -8200,8 +8200,10 @@
       const CXXDestructorDecl *Dtor =
               DelayedDestructorExceptionSpecChecks.back().first;
       if (Dtor->getParent() == Record) {
-        CheckOverridingFunctionExceptionSpec(Dtor,
-            DelayedDestructorExceptionSpecChecks.back().second);
+        // Don't check if we're a template. The spec hasn't been adjusted.
+        if (!Dtor->getParent()->isDependentType())
+          CheckOverridingFunctionExceptionSpec(Dtor,
+              DelayedDestructorExceptionSpecChecks.back().second);
         DelayedDestructorExceptionSpecChecks.pop_back();
       }
     }