]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - gcc/cp/pt.c
re PR c++/68309 (ICE: Segmentation fault)
[thirdparty/gcc.git] / gcc / cp / pt.c
index 60cc94c2aac4c8d766db5d00164fa80ee7786152..a45e6df9e8b0b1bb2927b41a1c03e954e2704daf 100644 (file)
@@ -21725,8 +21725,13 @@ instantiate_decl (tree d, int defer_ok,
         template from within the body of another.  */
       saved_local_specializations = local_specializations;
 
-      /* Set up the list of local specializations.  */
-      local_specializations = new hash_map<tree, tree>;
+      /* Set up the list of local specializations, copying the current
+        list if there is one.  */
+      if (local_specializations)
+       local_specializations
+         = new hash_map<tree, tree> (*local_specializations);
+      else
+       local_specializations = new hash_map<tree, tree>;
 
       /* Set up context.  */
       if (DECL_OMP_DECLARE_REDUCTION_P (code_pattern)