The following fixes a link failure due to missing skeleton
ancestors.
PR debug/110885
* dwarf2out.cc (generate_skeleton_bottom_up): Generate the
skeleton ancestor tree when moving a new child to the parent
even for template instantiations.
* g++.dg/debug/dwarf2/pr110885.C: New testcase.
type unit. Just move the DIE and its children back to
the skeleton tree (in the main CU). */
remove_child_with_prev (c, prev);
+ generate_skeleton_ancestor_tree (parent);
add_child_die (parent->new_die, c);
c = prev;
}
--- /dev/null
+// { dg-do link }
+// { dg-options "-gsplit-dwarf -fdebug-types-section" }
+
+inline void foo() {}
+
+struct Y
+{
+ template<void (*func)()>
+ static void bar() {}
+};
+
+int main()
+{
+ Y::bar<foo>();
+ return 0;
+}