[Bug middle-end/96390] [OpenMP] Link errors on the offload side for C++ code with templates

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jul 31 14:52:20 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96390

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The following helps with the "S<0>::S()" problem – but then one runs into the
"V<1>::V" problem.

--- a/gcc/omp-offload.c
+++ b/gcc/omp-offload.c
@@ -207,6 +207,12 @@ omp_discover_declare_target_tgt_fn_r (tree *tp, int 
       symtab_node *node = symtab_node::get (*tp);
       if (node != NULL)
        {
+         if (node->cpp_implicit_alias)
+           {
+             node = node->get_alias_target ();
+             DECL_ATTRIBUTES (node->decl)
+               = tree_cons (id, NULL_TREE, DECL_ATTRIBUTES (node->decl));
+           }
          node->offloadable = 1;
          if (ENABLE_OFFLOADING)
            g->have_offload = true;


More information about the Gcc-bugs mailing list