Commit 9ca57929 by Paolo Carlini Committed by Paolo Carlini

re PR c++/58843 (ICE with broken destructor call)

/cp
2014-01-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58843
	* typeck.c (lookup_destructor): Check dtor_type for error_mark_node.

/testsuite
2014-01-30  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/58843
	* g++.dg/lookup/crash8.C: New.

From-SVN: r207305
parent e1b317ae
2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58843
* typeck.c (lookup_destructor): Check dtor_type for error_mark_node.
2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58649
* pt.c (lookup_template_class_1): Check start_enum return value
for error_mark_node.
......
......@@ -2486,6 +2486,10 @@ lookup_destructor (tree object, tree scope, tree dtor_name,
tree dtor_type = TREE_OPERAND (dtor_name, 0);
tree expr;
/* We've already complained about this destructor. */
if (dtor_type == error_mark_node)
return error_mark_node;
if (scope && !check_dtor_name (scope, dtor_type))
{
if (complain & tf_error)
......
2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58843
* g++.dg/lookup/crash8.C: New.
2014-01-30 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/58649
* g++.dg/template/crash117.C: New.
......
// PR c++/58843
struct A {};
template<typename T> void foo(T t)
{
t.T::~X(); // { dg-error "no type" }
}
void bar()
{
foo(A());
}
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