if (HasSFINAEDiagnostic)
return;
SuppressedDiagnostics.clear();
- SuppressedDiagnostics.push_back(
- std::make_pair(Loc, PartialDiagnostic::NullDiagnostic()));
- SuppressedDiagnostics.back().second.swap(PD);
+ SuppressedDiagnostics.emplace_back(Loc, std::move(PD));
HasSFINAEDiagnostic = true;
}
PartialDiagnostic PD) {
if (HasSFINAEDiagnostic)
return;
- SuppressedDiagnostics.push_back(
- std::make_pair(Loc, PartialDiagnostic::NullDiagnostic()));
- SuppressedDiagnostics.back().second.swap(PD);
+ SuppressedDiagnostics.emplace_back(Loc, std::move(PD));
}
/// \brief Iterator over the set of suppressed diagnostics.
/// \brief Add a new candidate with NumConversions conversion sequence slots
/// to the overload set.
TemplateSpecCandidate &addCandidate() {
- Candidates.push_back(TemplateSpecCandidate());
+ Candidates.emplace_back();
return Candidates.back();
}
PP.getDiagnostics().SetArgToStringFn(&FormatASTNodeDiagnosticArgument,
&Context);
- ExprEvalContexts.push_back(
- ExpressionEvaluationContextRecord(PotentiallyEvaluated, 0,
- false, nullptr, false));
+ ExprEvalContexts.emplace_back(PotentiallyEvaluated, 0, false, nullptr, false);
FunctionScopes.push_back(new FunctionScopeInfo(Diags));
Sema::PushExpressionEvaluationContext(ExpressionEvaluationContext NewContext,
Decl *LambdaContextDecl,
bool IsDecltype) {
- ExprEvalContexts.push_back(
- ExpressionEvaluationContextRecord(NewContext,
- ExprCleanupObjects.size(),
- ExprNeedsCleanups,
- LambdaContextDecl,
- IsDecltype));
+ ExprEvalContexts.emplace_back(NewContext, ExprCleanupObjects.size(),
+ ExprNeedsCleanups, LambdaContextDecl,
+ IsDecltype);
ExprNeedsCleanups = false;
if (!MaybeODRUseExprs.empty())
std::swap(MaybeODRUseExprs, ExprEvalContexts.back().SavedMaybeODRUseExprs);
bool HasArithmeticOrEnumeralCandidateType = false;
SmallVector<BuiltinCandidateTypeSet, 2> CandidateTypes;
for (unsigned ArgIdx = 0, N = Args.size(); ArgIdx != N; ++ArgIdx) {
- CandidateTypes.push_back(BuiltinCandidateTypeSet(*this));
+ CandidateTypes.emplace_back(*this);
CandidateTypes[ArgIdx].AddTypesConvertedFrom(Args[ArgIdx]->getType(),
OpLoc,
true,