https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95197
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> --- For e.g. void bar (I<int> &a); void foo (I<int> &a) { #pragma omp task //firstprivate (a) bar (a); } with the same templates this is handled by omp_cxx_notice_variable, which will 1068 get_copy_ctor (type, tf_none); 1069 get_dtor (type, tf_none); because when it is done only during gimplification, we don't instantiate it anymore. So, I think I need to go through all the lang_hooks.decls.omp_finish_clause calls in the gimplifier and deal with it similarly during genericization time.