Don't stash types that aren't copyable or moveable into a SmallVector

This seems to be working by accident.
This commit is contained in:
Benjamin Kramer 2020-04-26 22:44:31 +02:00
parent cc1c516558
commit c0f210d636
2 changed files with 6 additions and 14 deletions

View File

@ -5121,20 +5121,19 @@ static bool evaluateTypeTrait(Sema &S, TypeTrait Kind, SourceLocation KWLoc,
if (RD && RD->isAbstract())
return false;
SmallVector<OpaqueValueExpr, 2> OpaqueArgExprs;
llvm::BumpPtrAllocator OpaqueExprAllocator;
SmallVector<Expr *, 2> ArgExprs;
ArgExprs.reserve(Args.size() - 1);
for (unsigned I = 1, N = Args.size(); I != N; ++I) {
QualType ArgTy = Args[I]->getType();
if (ArgTy->isObjectType() || ArgTy->isFunctionType())
ArgTy = S.Context.getRValueReferenceType(ArgTy);
OpaqueArgExprs.push_back(
ArgExprs.push_back(
new (OpaqueExprAllocator.Allocate<OpaqueValueExpr>())
OpaqueValueExpr(Args[I]->getTypeLoc().getBeginLoc(),
ArgTy.getNonLValueExprType(S.Context),
Expr::getValueKindForType(ArgTy)));
}
for (Expr &E : OpaqueArgExprs)
ArgExprs.push_back(&E);
// Perform the initialization in an unevaluated context within a SFINAE
// trap at translation unit scope.

View File

@ -145,13 +145,6 @@ class CombinationGenerator {
assert(!Range.empty() && "The range must not be empty.");
rewind();
}
// Only allow using our custom constructor.
WrappingIterator() = delete;
WrappingIterator(const WrappingIterator &) = delete;
WrappingIterator(WrappingIterator &&) = delete;
WrappingIterator &operator=(const WrappingIterator &) = delete;
WrappingIterator &operator=(WrappingIterator &&) = delete;
};
const ArrayRef<choices_storage_type> VariablesChoices;