[clang] [OpenMP] Support capturing structured bindings in OpenMP regions. (PR #190832)

Zahira Ammarguellat via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 06:28:32 PDT 2026


================

----------------
zahiraam wrote:

I investigated adding `IsBindingDecl` to this condition. However, this creates     many failures throughout the `lastprivate` `codegen` paths that assume only `VarDecl`'s are present:
  1. `SemaOpenMP.cpp`:2974 - `EndOpenMPDSABlock / FinalizeLastprivate` 
  2. `CGStmtOpenMP.cpp`:1437 - `EmitOMPLastprivateClauseInit` 
  3.` CGStmtOpenMP.cpp`:1546 - `EmitOMPLastprivateClauseFinal` (multiple locations).
  4. `CGStmtOpenMP.cpp`:1910, 1921 - `checkForLastprivateConditionalUpdate`   
  5. `CGOpenMPRuntime.cpp`:5665 - `generateUniqueName`                                                                            
  6. Potentially more in the OpenMP runtime implementation                                      
                                                                                           
The entire `lastprivate` infrastructure in both `Sema` and `CodeGen` was designed around` VarDecls` having storage that can be written back to.                                                   
Can we defer `lastprivate` support for `BindingDecls` to a follow-up PR? 

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


More information about the cfe-commits mailing list