summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaTemplate.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplate.cpp19
1 files changed, 3 insertions, 16 deletions
diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp
index 6d40e00b21a..e9977d42aa2 100644
--- a/clang/lib/Sema/SemaTemplate.cpp
+++ b/clang/lib/Sema/SemaTemplate.cpp
@@ -6501,11 +6501,11 @@ bool Sema::CheckFunctionTemplateSpecialization(
// it will be a static member function until we know which template it
// specializes), so adjust it now assuming it specializes this template.
QualType FT = FD->getType();
- const FunctionProtoType *FPT = FT->castAs<FunctionProtoType>();
- FunctionDecl *TmplFD = FunTmpl->getTemplatedDecl();
if (FD->isConstexpr()) {
- CXXMethodDecl *OldMD = dyn_cast<CXXMethodDecl>(TmplFD);
+ CXXMethodDecl *OldMD =
+ dyn_cast<CXXMethodDecl>(FunTmpl->getTemplatedDecl());
if (OldMD && OldMD->isConst()) {
+ const FunctionProtoType *FPT = FT->castAs<FunctionProtoType>();
FunctionProtoType::ExtProtoInfo EPI = FPT->getExtProtoInfo();
EPI.TypeQuals |= Qualifiers::Const;
FT = Context.getFunctionType(FPT->getResultType(), FPT->getArgTypes(),
@@ -6513,19 +6513,6 @@ bool Sema::CheckFunctionTemplateSpecialization(
}
}
- // Ignore differences in calling convention and noreturn until decl
- // merging.
- const FunctionProtoType *TmplFT =
- TmplFD->getType()->castAs<FunctionProtoType>();
- 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);
- }
-
// C++ [temp.expl.spec]p11:
// A trailing template-argument can be left unspecified in the
// template-id naming an explicit function template specialization
OpenPOWER on IntegriCloud