diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-02 20:59:25 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-04-02 20:59:25 +0000 |
commit | 5bdaac5454d93d1dcdc2319818497b685be56fcf (patch) | |
tree | fbf67c57fa5cdd443d079a9f6f149baf2535f57a /lib/Sema/SemaOverload.cpp | |
parent | 460ef136eb96b879f149c8703938a13c35b4bc68 (diff) |
Finish PR10217: Ensure we say that a special member was implicitly, not
explicitly, deleted in all relevant cases, and explain why.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153894 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index e1d32056eb..27b04a7427 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -8237,7 +8237,8 @@ void NoteFunctionCandidate(Sema &S, OverloadCandidate *Cand, OverloadCandidateKind FnKind = ClassifyOverloadCandidate(S, Fn, FnDesc); S.Diag(Fn->getLocation(), diag::note_ovl_candidate_deleted) - << FnKind << FnDesc << Fn->isDeleted(); + << FnKind << FnDesc + << (Fn->isDeleted() ? (Fn->isDeletedAsWritten() ? 1 : 2) : 0); MaybeEmitInheritedConstructorNote(S, Fn); return; } @@ -10086,9 +10087,11 @@ Sema::CreateOverloadedBinOp(SourceLocation OpLoc, << getSpecialMember(Method) << BinaryOperator::getOpcodeStr(Opc) << getDeletedOrUnavailableSuffix(Best->Function); - - if (Method->getParent()->isLambda()) { - Diag(Method->getParent()->getLocation(), diag::note_lambda_decl); + + if (getSpecialMember(Method) != CXXInvalid) { + // The user probably meant to call this special member. Just + // explain why it's deleted. + NoteDeletedFunction(Method); return ExprError(); } } else { |