diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-02-04 01:14:30 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-02-04 01:14:30 +0000 |
commit | bdd146435ff77f63c83823eeec4d763c6fb9a2d8 (patch) | |
tree | d61a74713f68cd0623c1ea8e690bc79f74c0e800 /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | 7437589fa186d1f0e58d7528bf9b7351fae5ffdc (diff) | |
download | bcm5719-llvm-bdd146435ff77f63c83823eeec4d763c6fb9a2d8.tar.gz bcm5719-llvm-bdd146435ff77f63c83823eeec4d763c6fb9a2d8.zip |
Add implicit declarations of allocation functions when looking them up for
redeclaration, not just when looking them up for a use -- we need the implicit
declaration to appropriately check various properties of them (notably, whether
they're deleted).
llvm-svn: 200729
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 9b6407b0b28..fbaf5115b61 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -11948,10 +11948,13 @@ 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()) && !Prev->isDefined()) { + if ((Prev->getTemplateSpecializationKind() != TSK_ExplicitSpecialization || + Prev->getPreviousDecl()) && + !Prev->isDefined()) { Diag(DelLoc, diag::err_deleted_decl_not_first); - Diag(Prev->getLocation(), diag::note_previous_declaration); + Diag(Prev->getLocation().isInvalid() ? DelLoc : Prev->getLocation(), + Prev->isImplicit() ? diag::note_previous_implicit_declaration + : diag::note_previous_declaration); } // If the declaration wasn't the first, we delete the function anyway for // recovery. |