[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:49 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).
----------------
shafik wrote:

```suggestion
  // No allocator expression → Null mem alloc.
```

https://github.com/llvm/llvm-project/pull/158146


More information about the cfe-commits mailing list