@@ -841,14 +841,10 @@ OpenACCClause *SemaOpenACCClauseVisitor::VisitAttachClause(
841
841
842
842
// ActOnVar ensured that everything is a valid variable reference, but we
843
843
// still have to make sure it is a pointer type.
844
- llvm::SmallVector<Expr *> VarList{Clause.getVarList ().begin (),
845
- Clause.getVarList ().end ()};
846
- VarList.erase (std::remove_if (VarList.begin (), VarList.end (),
847
- [&](Expr *E) {
848
- return SemaRef.CheckVarIsPointerType (
849
- OpenACCClauseKind::Attach, E);
850
- }),
851
- VarList.end ());
844
+ llvm::SmallVector<Expr *> VarList{Clause.getVarList ()};
845
+ llvm::erase_if (VarList, [&](Expr *E) {
846
+ return SemaRef.CheckVarIsPointerType (OpenACCClauseKind::Attach, E);
847
+ });
852
848
Clause.setVarListDetails (VarList,
853
849
/* IsReadOnly=*/ false , /* IsZero=*/ false );
854
850
return OpenACCAttachClause::Create (Ctx, Clause.getBeginLoc (),
@@ -866,14 +862,10 @@ OpenACCClause *SemaOpenACCClauseVisitor::VisitDevicePtrClause(
866
862
867
863
// ActOnVar ensured that everything is a valid variable reference, but we
868
864
// still have to make sure it is a pointer type.
869
- llvm::SmallVector<Expr *> VarList{Clause.getVarList ().begin (),
870
- Clause.getVarList ().end ()};
871
- VarList.erase (std::remove_if (VarList.begin (), VarList.end (),
872
- [&](Expr *E) {
873
- return SemaRef.CheckVarIsPointerType (
874
- OpenACCClauseKind::DevicePtr, E);
875
- }),
876
- VarList.end ());
865
+ llvm::SmallVector<Expr *> VarList{Clause.getVarList ()};
866
+ llvm::erase_if (VarList, [&](Expr *E) {
867
+ return SemaRef.CheckVarIsPointerType (OpenACCClauseKind::DevicePtr, E);
868
+ });
877
869
Clause.setVarListDetails (VarList,
878
870
/* IsReadOnly=*/ false , /* IsZero=*/ false );
879
871
0 commit comments