Commit b0a87402 by Paolo Carlini Committed by Paolo Carlini

re PR c++/60383 (ICE with invalid template specialization)

/cp
2014-03-13  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/60383
	* pt.c (maybe_process_partial_specialization): Check return value
	of check_specialization_namespace.

/testsuite
2014-03-13  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/60383
	* g++.dg/template/crash118.C: New.
	* g++.dg/template/crash95.C: Adjust.

From-SVN: r208550
parent 7891065a
2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60383
* pt.c (maybe_process_partial_specialization): Check return value
of check_specialization_namespace.
2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60254
* semantics.c (finish_static_assert): Call cxx_constant_value only
if require_potential_rvalue_constant_expression returns true.
......
......@@ -850,7 +850,9 @@ maybe_process_partial_specialization (tree type)
if (CLASSTYPE_IMPLICIT_INSTANTIATION (type)
&& !COMPLETE_TYPE_P (type))
{
check_specialization_namespace (CLASSTYPE_TI_TEMPLATE (type));
if (!check_specialization_namespace (CLASSTYPE_TI_TEMPLATE (type))
&& !at_namespace_scope_p ())
return error_mark_node;
SET_CLASSTYPE_TEMPLATE_SPECIALIZATION (type);
DECL_SOURCE_LOCATION (TYPE_MAIN_DECL (type)) = input_location;
if (processing_template_decl)
......
2014-03-13 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60383
* g++.dg/template/crash118.C: New.
* g++.dg/template/crash95.C: Adjust.
2014-03-13 Vladimir Makarov <vmakarov@redhat.com>
PR rtl-optimization/57189
......
// PR c++/60383
template<int> struct A
{
template<typename> struct B
{
template<typename T> struct B<T*> {}; // { dg-error "specialization" }
};
};
A<0>::B<char*> b;
......@@ -8,4 +8,4 @@ template < typename > struct S
};
};
S < int > s(0); // { dg-error "incomplete type" }
S < int > s(0); // { dg-error "no matching" }
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