aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-03-24 22:27:57 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-03-24 22:27:57 +0000
commit50de12f5783b57c74fd30ebfa3945181313625ff (patch)
treecfa3b0dd1ca4ab29aebd1b216fd0ebba653aa063 /lib/Sema/SemaDeclCXX.cpp
parent8d9aefcb479cf2d1a5e397114ed3e22429ab9ac0 (diff)
Parse deleted function definitions and hook them up to Doug's machinery.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67653 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index af71e71ec8..a85d62bc41 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -2501,3 +2501,19 @@ Sema::DeclTy *Sema::ActOnStaticAssertDeclaration(SourceLocation AssertLoc,
CurContext->addDecl(Decl);
return Decl;
}
+
+void Sema::SetDeclDeleted(DeclTy *dcl, SourceLocation DelLoc) {
+ Decl *Dcl = static_cast<Decl*>(dcl);
+ FunctionDecl *Fn = dyn_cast<FunctionDecl>(Dcl);
+ if (!Fn) {
+ Diag(DelLoc, diag::err_deleted_non_function);
+ return;
+ }
+ if (const FunctionDecl *Prev = Fn->getPreviousDeclaration()) {
+ Diag(DelLoc, diag::err_deleted_decl_not_first);
+ Diag(Prev->getLocation(), diag::note_previous_declaration);
+ // If the declaration wasn't the first, we delete the function anyway for
+ // recovery.
+ }
+ Fn->setDeleted();
+}