diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index b334ba568ad2..c1abf099e9f2 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/lib/Sema/SemaExceptionSpec.cpp @@ -263,8 +263,7 @@ static bool hasImplicitExceptionSpec(FunctionDecl *Decl) { if (!Decl->getTypeSourceInfo()) return isa(Decl); - const FunctionProtoType *Ty = - Decl->getTypeSourceInfo()->getType()->getAs(); + auto *Ty = Decl->getTypeSourceInfo()->getType()->castAs(); 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(), + Old->getType()->castAs(), Old->getLocation(), - New->getType()->getAs(), + New->getType()->castAs(), New->getLocation()); }