OverloadCandidateSet(const OverloadCandidateSet &) LLVM_DELETED_FUNCTION;
void operator=(const OverloadCandidateSet &) LLVM_DELETED_FUNCTION;
+ void destroyCandidates();
+
public:
OverloadCandidateSet(SourceLocation Loc) : Loc(Loc), NumInlineSequences(0){}
- ~OverloadCandidateSet() { clear(); }
+ ~OverloadCandidateSet() { destroyCandidates(); }
SourceLocation getLocation() const { return Loc; }
return 0;
}
-void OverloadCandidateSet::clear() {
+void OverloadCandidateSet::destroyCandidates() {
for (iterator i = begin(), e = end(); i != e; ++i) {
for (unsigned ii = 0, ie = i->NumConversions; ii != ie; ++ii)
i->Conversions[ii].~ImplicitConversionSequence();
if (!i->Viable && i->FailureKind == ovl_fail_bad_deduction)
i->DeductionFailure.Destroy();
}
+}
+
+void OverloadCandidateSet::clear() {
+ destroyCandidates();
NumInlineSequences = 0;
Candidates.clear();
Functions.clear();