Hi all, On 05.05.22 11:12, Jakub Jelinek via Gcc-patches wrote: → https://gcc.gnu.org/pipermail/gcc-patches/2022-May/594082.html > On Wed, Mar 09, 2022 at 07:04:24PM +0800, Chung-Lin Tang wrote: → https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591449.html >> Now in OpenMP 5.x, static members are supposed to be not a barrier for a class >> to be target-mapped. >> >> There is the related issue of actually providing access to static const/constexpr >> members on the GPU (probably a case of https://github.com/OpenMP/spec/issues/2158) >> but that is for later. >> >> This patch basically just removes the check for static members inside >> cp_omp_mappable_type_1, and adjusts a testcase. Not sure if more tests are needed. >> Tested on trunk without regressions, okay when stage1 reopens? > I don't see anything useful left in cp_omp_mappable_type{,_1}. > In particular, starting with OpenMP 5.0, for both C and C++ we just say > that a mappable type is a complete type. True, for C++ there is also the > "All member functions accessed in any target region must appear in a > declare target directive." > and similarly for Fortran, but that isn't something we really can check [...] I have now removed the hook as suggested. > Now, the C++ FE has also cp_omp_emit_unmappable_type_notes while other FEs > don't, either we can just say that type doesn't have mappable type > like the C FE does, or perhaps just can emit a note that it isn't a mappable > type because it is incomplete (but then it would be nice to do the same > thing in the C FE too). I looked into this – but I think only C++ has TYPE_MAIN_DECL; without being able to get the DECL_SOURCE_LOCATION, adding an "inform" does not really help. Instead of the omp-specific emit function, I now use cxx_incomplete_type_inform, which avoids printing a pointless "note:"/inform if no source location is available and uses common wording. (Visible with the added example, which printed before for some errors the omp-specific inform and for others the cp-generic inform.) (Actually, the testcase shows some overdiagnostic - for the single incomplete-type issue, there are 3 error message (two identical) and with C++ trice the same inform/"note:". This is unchanged with this patch.) The code could be simplified by removing the COMPLETE_TYPE_P condition before cxx_incomplete_type_inform in cp/{decl,semantics}.cc, given that in omp_mappable_type(), the only check besides error_node is !COMPLETE_TYPE_P. The patch passes bootstrapping and regtesting on x86-64-gnu-linux. OK? Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955