[clang] [flang] [clang][OpenMP] Diagnose invalid allocator in `#pragma omp allocate`; avoid null deref (PR #158146)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 11 13:51:39 PDT 2025
================
@@ -3321,27 +3321,33 @@ SemaOpenMP::CheckOMPThreadPrivateDecl(SourceLocation Loc,
}
return D;
}
-
static OMPAllocateDeclAttr::AllocatorTypeTy
getAllocatorKind(Sema &S, DSAStackTy *Stack, Expr *Allocator) {
+ // No allocator expression → Null mem alloc (matches existing tests).
if (!Allocator)
return OMPAllocateDeclAttr::OMPNullMemAlloc;
+
----------------
shafik wrote:
All these extra newlines are not necessary and should be dropped. They add a lot of noise to the change.
https://github.com/llvm/llvm-project/pull/158146
More information about the cfe-commits
mailing list