diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-10 21:52:04 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2011-09-10 21:52:04 +0000 |
commit | afc5b15022886c9e9e84d7aa0f2168b83e712310 (patch) | |
tree | 418b4e0ae232fc523da5cb5d023495a2b911d4f9 /lib/Sema/SemaOverload.cpp | |
parent | 3a448fb539f66b204a6119946973d29fa5547574 (diff) |
Silence "end of non-void function" warnings with llvm_unreachable and add an assert.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139474 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaOverload.cpp')
-rw-r--r-- | lib/Sema/SemaOverload.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaOverload.cpp b/lib/Sema/SemaOverload.cpp index c200daedfb..cce4057dd7 100644 --- a/lib/Sema/SemaOverload.cpp +++ b/lib/Sema/SemaOverload.cpp @@ -7288,10 +7288,12 @@ SourceLocation GetLocationForCandidate(const OverloadCandidate *Cand) { return SourceLocation(); } -static unsigned RankDeductionFailure( - const OverloadCandidate::DeductionFailureInfo &DFI) { +static unsigned +RankDeductionFailure(const OverloadCandidate::DeductionFailureInfo &DFI) { switch ((Sema::TemplateDeductionResult)DFI.Result) { case Sema::TDK_Success: + assert(0 && "TDK_success while diagnosing bad deduction"); + case Sema::TDK_Incomplete: return 1; @@ -7314,6 +7316,7 @@ static unsigned RankDeductionFailure( case Sema::TDK_TooFewArguments: return 6; } + llvm_unreachable("Unhandled deduction result"); } struct CompareOverloadCandidatesForDisplay { |