Hello OpenMP 5.0 has a new feature for implicitly marking variables and functions that are referenced in the initializers of static variables and functions that are already marked 'declare target'. Support was added in the commit 'openmp: Implement discovery of implicit declare target to clauses' (dc703151d4f4560e647649506d5b4ceb0ee11e90). However, this does not work with non-constant C++ initializers, where the initializers can contain references to other (non-constant) variables and function calls. The C++ front-end stores the initialization information in the static_aggregates list (with the variable decl in the TREE_VALUE of an entry and the initialization in TREE_PURPOSE) rather than in TREE_INITIAL(var_decl). I have added an extra function in omp-offload.cpp to walk the variable initialiser trees in static_aggregates, and added a call to it from the FE shortly before the initializations are emitted. I have also added a testcase to ensure that the implicitly marked variables/functions can be referenced in offloaded code. The libgomp tests have been run with offloading to a Nvidia card with no regressions, and I have also bootstrapped the compiler with no offloading on x86-64. Okay for trunk? Thanks Kwok