aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-12-14 15:54:17 -0500
committerJason Merrill <jason@gcc.gnu.org>2015-12-14 15:54:17 -0500
commitfa583f9e654fb4c7137a869d767858534f0bb535 (patch)
tree05360f26f61441741762e034d1fa1b831ba0023b /gcc/cp
parent1cb62d16c2d4c090117766d5dfc67c5badb0617c (diff)
downloadgcc-fa583f9e654fb4c7137a869d767858534f0bb535.zip
gcc-fa583f9e654fb4c7137a869d767858534f0bb535.tar.gz
gcc-fa583f9e654fb4c7137a869d767858534f0bb535.tar.bz2
re PR c++/68309 (ICE: Segmentation fault)
PR c++/68309 gcc/ * hash-table.h: Add copy constructor. * hash-map.h: Add copy constructor. gcc/cp/ * pt.c (instantiate_decl): Copy local_specializations for nested function. From-SVN: r231632
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/pt.c9
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e8bcba5..69c1887 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2015-12-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/68309
+ * pt.c (instantiate_decl): Copy local_specializations for nested
+ function.
+
2015-12-09 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60218
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 60cc94c..a45e6df 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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)