================
@@ -2215,17 +2215,11 @@ Parser::DeclGroupPtrTy
Parser::ParseOpenMPDeclarativeDirectiveWithExtDecl(
return DeclGroupPtrTy();
}
- auto HasNewDecl = [&] {
- DeclGroupRef DG = Ptr.get();
- SourceManager &SM = PP.getSourceManager();
- for (const Decl *D : DG) {
- if (SM.isBeforeInTranslationUnit(Loc, D->getBeginLoc()))
- return true;
- }
- return false;
- };
-
- if (!HasNewDecl()) {
+ DeclGroupRef DG = Ptr.get();
+ SourceManager &SM = PP.getSourceManager();
+ if (!llvm::any_of(DG, [&](const Decl *D) {
+ return SM.isBeforeInTranslationUnit(Loc, D->getBeginLoc());
+ })) {
----------------
TPPPP72 wrote:
@alexey-bataev Oh, it should be `SM.isBeforeInTranslationUnit(Loc,
D->getBeginLoc());` not `!SM.isBeforeInTranslationUnit(Loc, D->getBeginLoc());`
^_^
https://github.com/llvm/llvm-project/pull/217875
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits