@@ -3525,7 +3525,7 @@ maybe_record_mergeable_decl (tree *slot, tree name, tree decl)
if (!partition)
{
binding_slot &orig
- = BINDING_VECTOR_CLUSTER (*gslot, 0).slots[BINDING_SLOT_CURRENT];
+ = BINDING_VECTOR_CLUSTER (*slot, 0).slots[BINDING_SLOT_CURRENT];
if (!STAT_HACK_P (tree (orig)))
orig = stat_hack (tree (orig));
new file mode 100644
@@ -0,0 +1,6 @@
+// PR 99071 ICE with global-module merging
+// { dg-additional-options -fmodule-header }
+// { dg-module-cmi {} }
+
+template<typename T>
+void begin (T *);
new file mode 100644
@@ -0,0 +1,8 @@
+// PR 99071 ICE with global-module merging
+// { dg-additional-options -fmodule-header }
+// { dg-module-cmi {} }
+
+import "pr99071_a.H";
+
+template<typename T>
+void begin(T &);