Commit ae5cbc33 by Roger Sayle

name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by returning when…

name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by returning when TREE_TYPE is error_mark_node.


	* name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
	returning when TREE_TYPE is error_mark_node.
	* typeck.c (require_complete_type): Return error_mark_node if
	value's type is an error_mark_node.

	* g++.dg/lookup/forscope2.C: New test case.

From-SVN: r82133
parent b7e6a6b3
2004-05-22 Roger Sayle <roger@eyesopen.com>
* name-lookup.c (check_for_out_of_scope_variable): Avoid ICE by
returning when TREE_TYPE is error_mark_node.
* typeck.c (require_complete_type): Return error_mark_node if
value's type is an error_mark_node.
2005-05-20 Andrew Pinski <pinskia@physics.uc.edu>
* optimize.c (calls_setjmp_r): Remove.
......
......@@ -1151,6 +1151,10 @@ check_for_out_of_scope_variable (tree decl)
return decl;
DECL_ERROR_REPORTED (decl) = 1;
if (TREE_TYPE (decl) == error_mark_node)
return decl;
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (TREE_TYPE (decl)))
{
error ("name lookup of `%D' changed for new ISO `for' scoping",
......
......@@ -96,6 +96,9 @@ require_complete_type (tree value)
else
type = TREE_TYPE (value);
if (type == error_mark_node)
return error_mark_node;
/* First, detect a valid value with a complete type. */
if (COMPLETE_TYPE_P (type))
return value;
......
2004-05-22 Wolfgang Bangerth <bangerth@dealii.org>
Roger Sayle <roger@eyesopen.com>
* g++.dg/lookup/forscope2.C: New test case.
2004-05-22 Ben Elliston <bje@au.ibm.com>
* gcc.dg/cpp/Wmissingdirs.c: New.
......
// { dg-do compile }
struct S {
void foo() {
for (_ptr; ;) {} // { dg-error "not declared" }
_ptr = 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