Commit e7fc41a7 by Markus Trippelsdorf Committed by Markus Trippelsdorf

Fix c++/67337 (segfault in mangle.c)

	PR c++/67337
	* mangle.c (write_template_prefix): Guard against context==NULL.

From-SVN: r231203
parent 157bb85d
2015-12-02 Markus Trippelsdorf <markus@trippelsdorf.de>
PR c++/67337
* mangle.c (write_template_prefix): Guard against context==NULL.
2015-12-02 Jason Merrill <jason@redhat.com> 2015-12-02 Jason Merrill <jason@redhat.com>
* call.c (build_new_op_1): Don't fold arguments to * call.c (build_new_op_1): Don't fold arguments to
......
...@@ -1145,7 +1145,7 @@ write_template_prefix (const tree node) ...@@ -1145,7 +1145,7 @@ write_template_prefix (const tree node)
So, for the example above, `Outer<int>::Inner' is represented as a So, for the example above, `Outer<int>::Inner' is represented as a
substitution candidate by a TREE_LIST whose purpose is `Outer<int>' substitution candidate by a TREE_LIST whose purpose is `Outer<int>'
and whose value is `Outer<T>::Inner<U>'. */ and whose value is `Outer<T>::Inner<U>'. */
if (TYPE_P (context)) if (context && TYPE_P (context))
substitution = build_tree_list (context, templ); substitution = build_tree_list (context, templ);
else else
substitution = templ; substitution = templ;
......
template <class> class A
{
void m_fn1 (int *, int);
};
template <class> class B
{
public:
typedef int Type;
};
template <class> class C
{
public:
C (int);
template <template <class> class T> void m_fn2 (typename T<void>::Type);
};
template <>
void
A<int>::m_fn1 (int *, int)
{
C<int> a (0);
a.m_fn2<B> (0);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment