This patch improves the diagnostics given for unmappable C++ types in OpenMP programs. Here is the output *without* the patch, for the new testcase: ---- unmappable-1.C: In function 'int main()': unmappable-1.C:16:24: error: 'v' does not have a mappable type in 'map' clause 16 | #pragma omp target map(v) ---- This is correct, but not very helpful for anything but the most trivial C++ types. Anything involving inheritance, templates, typedefs, etc. could be extremely difficult to track down. With the patch applied we now get this (I removed the "dg-message" comments for clarity): ---- unmappable-1.C: In function 'int main()': unmappable-1.C:16:24: error: 'v' does not have a mappable type in 'map' clause 16 | #pragma omp target map(v) | ^ cc1plus: note: incomplete types are not mappable unmappable-1.C:4:7: note: types with virtual members are not mappable 4 | class C | ^ unmappable-1.C:7:14: note: static fields are not mappable 7 | static int static_member; | ^~~~~~~~~~~~~ ---- The compiler now reports all the problematic fields in the whole type, recursively. If anybody knows how to report the location of incomplete array declarations then that would be nice to add. OK to commit? Andrew