summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 319e63dbb18..1813aa0b648 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2949,6 +2949,15 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD,
// but do not necessarily update the type of New.
if (CheckEquivalentExceptionSpec(Old, New))
return true;
+ // If exceptions are disabled, we might not have resolved the exception spec
+ // of one or both declarations. Do so now in C++1z, so that we can properly
+ // compare the types.
+ if (getLangOpts().CPlusPlus1z) {
+ for (QualType T : {Old->getType(), New->getType()})
+ if (auto *FPT = T->getAs<FunctionProtoType>())
+ if (isUnresolvedExceptionSpec(FPT->getExceptionSpecType()))
+ ResolveExceptionSpec(New->getLocation(), FPT);
+ }
OldQType = Context.getCanonicalType(Old->getType());
NewQType = Context.getCanonicalType(New->getType());
OpenPOWER on IntegriCloud