From 461761d68f7393ef5205c6493a36c15ac79f6c71 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Sat, 8 May 2010 18:20:53 +0000 Subject: [PATCH] Minor cleanup, and ban copying of OverloadCandidateSets. No functionality change. llvm-svn: 103342 --- clang/lib/Sema/SemaOverload.cpp | 27 +++++++++++++-------------- clang/lib/Sema/SemaOverload.h | 4 ++++ 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/clang/lib/Sema/SemaOverload.cpp b/clang/lib/Sema/SemaOverload.cpp index 93e9c7f4e791..6f7063b98f36 100644 --- a/clang/lib/Sema/SemaOverload.cpp +++ b/clang/lib/Sema/SemaOverload.cpp @@ -296,13 +296,14 @@ static MakeDeductionFailureInfo(Sema::TemplateDeductionResult TDK, switch (TDK) { case Sema::TDK_Success: case Sema::TDK_InstantiationDepth: + case Sema::TDK_TooManyArguments: + case Sema::TDK_TooFewArguments: break; case Sema::TDK_Incomplete: Result.Data = Info.Param.getOpaqueValue(); break; - // Unhandled case Sema::TDK_Inconsistent: case Sema::TDK_InconsistentQuals: { DFIParamWithArguments *Saved = new DFIParamWithArguments; @@ -315,8 +316,6 @@ static MakeDeductionFailureInfo(Sema::TemplateDeductionResult TDK, case Sema::TDK_SubstitutionFailure: case Sema::TDK_NonDeducedMismatch: - case Sema::TDK_TooManyArguments: - case Sema::TDK_TooFewArguments: case Sema::TDK_InvalidExplicitArguments: case Sema::TDK_FailedOverloadResolution: break; @@ -330,19 +329,19 @@ void OverloadCandidate::DeductionFailureInfo::Destroy() { case Sema::TDK_Success: case Sema::TDK_InstantiationDepth: case Sema::TDK_Incomplete: + case Sema::TDK_TooManyArguments: + case Sema::TDK_TooFewArguments: break; - // Unhandled case Sema::TDK_Inconsistent: case Sema::TDK_InconsistentQuals: delete static_cast(Data); Data = 0; break; + // Unhandled case Sema::TDK_SubstitutionFailure: case Sema::TDK_NonDeducedMismatch: - case Sema::TDK_TooManyArguments: - case Sema::TDK_TooFewArguments: case Sema::TDK_InvalidExplicitArguments: case Sema::TDK_FailedOverloadResolution: break; @@ -354,6 +353,8 @@ OverloadCandidate::DeductionFailureInfo::getTemplateParameter() { switch (static_cast(Result)) { case Sema::TDK_Success: case Sema::TDK_InstantiationDepth: + case Sema::TDK_TooManyArguments: + case Sema::TDK_TooFewArguments: return TemplateParameter(); case Sema::TDK_Incomplete: @@ -366,8 +367,6 @@ OverloadCandidate::DeductionFailureInfo::getTemplateParameter() { // Unhandled case Sema::TDK_SubstitutionFailure: case Sema::TDK_NonDeducedMismatch: - case Sema::TDK_TooManyArguments: - case Sema::TDK_TooFewArguments: case Sema::TDK_InvalidExplicitArguments: case Sema::TDK_FailedOverloadResolution: break; @@ -381,17 +380,17 @@ const TemplateArgument *OverloadCandidate::DeductionFailureInfo::getFirstArg() { case Sema::TDK_Success: case Sema::TDK_InstantiationDepth: case Sema::TDK_Incomplete: + case Sema::TDK_TooManyArguments: + case Sema::TDK_TooFewArguments: return 0; - // Unhandled case Sema::TDK_Inconsistent: case Sema::TDK_InconsistentQuals: return &static_cast(Data)->FirstArg; + // Unhandled case Sema::TDK_SubstitutionFailure: case Sema::TDK_NonDeducedMismatch: - case Sema::TDK_TooManyArguments: - case Sema::TDK_TooFewArguments: case Sema::TDK_InvalidExplicitArguments: case Sema::TDK_FailedOverloadResolution: break; @@ -406,17 +405,17 @@ OverloadCandidate::DeductionFailureInfo::getSecondArg() { case Sema::TDK_Success: case Sema::TDK_InstantiationDepth: case Sema::TDK_Incomplete: + case Sema::TDK_TooManyArguments: + case Sema::TDK_TooFewArguments: return 0; - // Unhandled case Sema::TDK_Inconsistent: case Sema::TDK_InconsistentQuals: return &static_cast(Data)->SecondArg; + // Unhandled case Sema::TDK_SubstitutionFailure: case Sema::TDK_NonDeducedMismatch: - case Sema::TDK_TooManyArguments: - case Sema::TDK_TooFewArguments: case Sema::TDK_InvalidExplicitArguments: case Sema::TDK_FailedOverloadResolution: break; diff --git a/clang/lib/Sema/SemaOverload.h b/clang/lib/Sema/SemaOverload.h index b7b628886ca6..c13fb17b8584 100644 --- a/clang/lib/Sema/SemaOverload.h +++ b/clang/lib/Sema/SemaOverload.h @@ -580,6 +580,10 @@ namespace clang { llvm::SmallPtrSet Functions; SourceLocation Loc; + + OverloadCandidateSet(const OverloadCandidateSet &); + OverloadCandidateSet &operator=(const OverloadCandidateSet &); + public: OverloadCandidateSet(SourceLocation Loc) : Loc(Loc) {}