Ignore noreturn when checking function template specializations

As requested when applying the same logic to calling conventions.

Reviewers: rsmith

Differential Revision: http://llvm-reviews.chandlerc.com/D1634

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190441 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index b631330..d322335 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -6415,12 +6415,15 @@
         }
       }
 
-      // Ignore differences in calling convention until decl merging.
+      // Ignore differences in calling convention and noreturn until decl
+      // merging.
       const FunctionProtoType *TmplFT =
           TmplFD->getType()->castAs<FunctionProtoType>();
-      if (FPT->getCallConv() != TmplFT->getCallConv()) {
+      if (FPT->getCallConv() != TmplFT->getCallConv() ||
+          FPT->getNoReturnAttr() != TmplFT->getNoReturnAttr()) {
         FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
         EPI.ExtInfo = EPI.ExtInfo.withCallingConv(TmplFT->getCallConv());
+        EPI.ExtInfo = EPI.ExtInfo.withNoReturn(TmplFT->getNoReturnAttr());
         FT = Context.getFunctionType(FPT->getResultType(), FPT->getArgTypes(),
                                      EPI);
       }