ABataev added inline comments.

================
Comment at: clang/lib/Parse/ParseOpenMP.cpp:2134-2151
+    Sema::DeclareTargetContextInfo *DTCI =
+        new Sema::DeclareTargetContextInfo(DKind, DTLoc);
+    if (HasClauses)
+      ParseOMPDeclareTargetClauses(*DTCI);
 
     // Skip the last annot_pragma_openmp_end.
     ConsumeAnyToken();
----------------
jdoerfert wrote:
> ABataev wrote:
> > Add a RAII to control these new/delete or just create local var
> Local variable and RAII do not always work, there is a delete in the 
> `end_declare_target` below as well.
> 
> 
But here you have new/delete pair within a single block. Either you can put the 
ar into stack/RAII or some extra checks are missing. Maybe must be something 
like this:
```
if (DKind == OMPD_declare_target)
  delete DTCI;
```
?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D101030/new/

https://reviews.llvm.org/D101030

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to