This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/67337] [4.9/5/6 Regression] Segmentation fault on a template class
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 24 Aug 2015 10:36:41 +0000
- Subject: [Bug c++/67337] [4.9/5/6 Regression] Segmentation fault on a template class
- Auto-submitted: auto-generated
- References: <bug-67337-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67337
--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Testing obvious fix:
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 342cb93e68b3..a9993f40b94d 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -1149,7 +1149,7 @@ write_template_prefix (const tree node)
So, for the example above, `Outer<int>::Inner' is represented as a
substitution candidate by a TREE_LIST whose purpose is `Outer<int>'
and whose value is `Outer<T>::Inner<U>'. */
- if (TYPE_P (context))
+ if (context && TYPE_P (context))
substitution = build_tree_list (context, templ);
else
substitution = templ;