aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclCXX.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2012-06-29 18:00:25 +0000
committerDavid Blaikie <dblaikie@gmail.com>2012-06-29 18:00:25 +0000
commit619ee6acdd43b95b20c5aa96b22c3f238ce1a021 (patch)
tree435b05fbdde49e77147fbed065b02aec792069ad /lib/Sema/SemaDeclCXX.cpp
parentd68615f46da579fff14cc5ad028e5df79e97d03d (diff)
Avoid redundant error when redefining a function as deleted.
Reviewed by Doug Gregor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159442 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r--lib/Sema/SemaDeclCXX.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index dab2d4de09..babeaf7bd7 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -10318,8 +10318,8 @@ void Sema::SetDeclDeleted(Decl *Dcl, SourceLocation DelLoc) {
if (const FunctionDecl *Prev = Fn->getPreviousDecl()) {
// Don't consider the implicit declaration we generate for explicit
// specializations. FIXME: Do not generate these implicit declarations.
- if (Prev->getTemplateSpecializationKind() != TSK_ExplicitSpecialization
- || Prev->getPreviousDecl()) {
+ if ((Prev->getTemplateSpecializationKind() != TSK_ExplicitSpecialization
+ || Prev->getPreviousDecl()) && !Prev->isDefined()) {
Diag(DelLoc, diag::err_deleted_decl_not_first);
Diag(Prev->getLocation(), diag::note_previous_declaration);
}