diff options
Diffstat (limited to 'clang/lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExceptionSpec.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index 81fd3f96317..caa796d1f0a 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -204,7 +204,7 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) { FunctionProtoType::ExtProtoInfo EPI = NewProto->getExtProtoInfo(); EPI.ExceptionSpecType = EST_DynamicNone; QualType NewType = Context.getFunctionType(NewProto->getResultType(), - NewProto->getArgTypes(), EPI); + NewProto->getParamTypes(), EPI); New->setType(NewType); return false; } @@ -225,7 +225,7 @@ bool Sema::CheckEquivalentExceptionSpec(FunctionDecl *Old, FunctionDecl *New) { // Update the type of the function with the appropriate exception // specification. QualType NewType = Context.getFunctionType(NewProto->getResultType(), - NewProto->getArgTypes(), EPI); + NewProto->getParamTypes(), EPI); New->setType(NewType); // Warn about the lack of exception specification. @@ -720,14 +720,13 @@ bool Sema::CheckParamExceptionSpec(const PartialDiagnostic & NoteID, // We shouldn't even be testing this unless the arguments are otherwise // compatible. - assert(Target->getNumArgs() == Source->getNumArgs() && + assert(Target->getNumParams() == Source->getNumParams() && "Functions have different argument counts."); - for (unsigned i = 0, E = Target->getNumArgs(); i != E; ++i) { - if (CheckSpecForTypesEquivalent(*this, - PDiag(diag::err_deep_exception_specs_differ) << 1, - PDiag(), - Target->getArgType(i), TargetLoc, - Source->getArgType(i), SourceLoc)) + for (unsigned i = 0, E = Target->getNumParams(); i != E; ++i) { + if (CheckSpecForTypesEquivalent( + *this, PDiag(diag::err_deep_exception_specs_differ) << 1, PDiag(), + Target->getParamType(i), TargetLoc, Source->getParamType(i), + SourceLoc)) return true; } return false; |