diff options
author | Aaron Ballman <aaron@aaronballman.com> | 2013-01-16 23:39:10 +0000 |
---|---|---|
committer | Aaron Ballman <aaron@aaronballman.com> | 2013-01-16 23:39:10 +0000 |
commit | afb7ce3f877594362381926eaeac8ed6bbe18069 (patch) | |
tree | 7a3c344bbed5830c48e783dee6012eefa2939ae8 /lib/Sema/SemaDeclCXX.cpp | |
parent | 2df0df8de44845a441f07a37db5bfcadd0215019 (diff) |
Fixes crash when illegal function definitions are deleted or defaulted. Fixes PR14577.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172676 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index 5650781893..36b2043def 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -10815,7 +10815,7 @@ NamedDecl *Sema::ActOnFriendFunctionDecl(Scope *S, Declarator &D, void Sema::SetDeclDeleted(Decl *Dcl, SourceLocation DelLoc) { AdjustDeclIfTemplate(Dcl); - FunctionDecl *Fn = dyn_cast<FunctionDecl>(Dcl); + FunctionDecl *Fn = dyn_cast_or_null<FunctionDecl>(Dcl); if (!Fn) { Diag(DelLoc, diag::err_deleted_non_function); return; @@ -10835,7 +10835,7 @@ void Sema::SetDeclDeleted(Decl *Dcl, SourceLocation DelLoc) { } void Sema::SetDeclDefaulted(Decl *Dcl, SourceLocation DefaultLoc) { - CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(Dcl); + CXXMethodDecl *MD = dyn_cast_or_null<CXXMethodDecl>(Dcl); if (MD) { if (MD->getParent()->isDependentType()) { |