summaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExceptionSpec.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r--lib/Sema/SemaExceptionSpec.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Sema/SemaExceptionSpec.cpp b/lib/Sema/SemaExceptionSpec.cpp
index b334ba568a..c1abf099e9 100644
--- a/lib/Sema/SemaExceptionSpec.cpp
+++ b/lib/Sema/SemaExceptionSpec.cpp
@@ -263,8 +263,7 @@ static bool hasImplicitExceptionSpec(FunctionDecl *Decl) {
if (!Decl->getTypeSourceInfo())
return isa<CXXDestructorDecl>(Decl);
- const FunctionProtoType *Ty =
- Decl->getTypeSourceInfo()->getType()->getAs<FunctionProtoType>();
+ auto *Ty = Decl->getTypeSourceInfo()->getType()->castAs<FunctionProtoType>();
return !Ty->hasExceptionSpec();
}
@@ -965,9 +964,9 @@ bool Sema::CheckOverridingFunctionExceptionSpec(const CXXMethodDecl *New,
PDiag(diag::err_deep_exception_specs_differ),
PDiag(diag::note_overridden_virtual_function),
PDiag(diag::ext_override_exception_spec),
- Old->getType()->getAs<FunctionProtoType>(),
+ Old->getType()->castAs<FunctionProtoType>(),
Old->getLocation(),
- New->getType()->getAs<FunctionProtoType>(),
+ New->getType()->castAs<FunctionProtoType>(),
New->getLocation());
}