summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
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
commitaf031a9af781441d3025dda1bc652db8e98cc934 (patch)
treec0cab541b637afbd41b8a49a2811b0689cad1534 /clang/lib/Sema
parent674acc12d0d4cb260efba154a7e2e07581b64000 (diff)
downloadbcm5719-llvm-af031a9af781441d3025dda1bc652db8e98cc934.tar.gz
bcm5719-llvm-af031a9af781441d3025dda1bc652db8e98cc934.zip
Avoid redundant error when redefining a function as deleted.
Reviewed by Doug Gregor. llvm-svn: 159442
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index dab2d4de092..babeaf7bd77 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/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);
}
OpenPOWER on IntegriCloud