https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127559
--- Comment #17 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The trunk branch has been updated by Thomas Schwinge <[email protected]>: https://gcc.gnu.org/g:9d1f31a22fa5d9714c7e03bfdf716e3c8e38c3e5 commit r17-5499-g9d1f31a22fa5d9714c7e03bfdf716e3c8e38c3e5 Author: Thomas Schwinge <[email protected]> Date: Thu Oct 22 12:51:45 2026 +0200 openmp c++: Temporary fix for some lambda mapping problems: More testing, XFAILed regressions [PR127559] Since commit 84d5fecd2694ad70f391a20451d43d82fde37eb5 "openmp c++: Temporary fix for some lambda mapping problems [PR127559]", the C++ front end no longer maps lambda objects that are subobjects of aggregates, such as 'c.x' or 'd[y].x' in 'libgomp.c++/target-lambda-6.C', or their by-reference captures. 'gcc/cp/semantics.cc:finish_omp_target_clauses_r' looks through 'COMPONENT_REF's, 'ARRAY_REF's for a 'VAR_DECL', 'PARM_DECL', 'RESULT_DECL' base, but the base is wrapped in a 'VIEW_CONVERT_EXPR' (location wrapper), and therefore not recognized. Without the mapping for the by-reference capture of 'x', code offloading execution dereferences a host stack address, which faults in case that the device can't access host memory. Thus, XFAILing the 'libgomp.c++/target-lambda-6.C' execution test accordingly, and adding XFAILed 'scan-tree-dump's to it. The new 'g++.dg/gomp/target-lambda-3.C' also covers a nested aggregate, and a constant array index. With the commit mentioned above reverted, these all PASS, so this is a regression. Also adding a 'scan-tree-dump' to 'libgomp.c++/target-lambda-5.C' to verify that locally declared lambdas don't get mapped. Assisted-by: Anthropic Claude Opus 5.5 PR c++/127559 gcc/testsuite/ * g++.dg/gomp/target-lambda-3.C: New. libgomp/ * testsuite/libgomp.c++/target-lambda-5.C: Enhance testing. * testsuite/libgomp.c++/target-lambda-6.C: Likewise.
