Commit b815a631 by Volker Reichelt Committed by Volker Reichelt

re PR c++/26036 (Treating a class object as a function with member variables causes hang)

	PR c++/26036
	* typeck.c (convert_arguments): Return error_mark_node instead of
	error_mark_list.
	* cp-tree.h (error_mark_list): Remove declaration.
	* decl.c (error_mark_list): Remove definition.
	(cxx_init_decl_processing): Do not initialize error_mark_list.

	* g++.dg/expr/call3.C: New test.

From-SVN: r113087
parent d149fba0
2006-04-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-04-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/26036
* typeck.c (convert_arguments): Return error_mark_node instead of
error_mark_list.
* cp-tree.h (error_mark_list): Remove declaration.
* decl.c (error_mark_list): Remove definition.
(cxx_init_decl_processing): Do not initialize error_mark_list.
PR c++/10385 PR c++/10385
* rtti.c (build_dynamic_cast_1): Check for invalid conversions * rtti.c (build_dynamic_cast_1): Check for invalid conversions
before calling convert_to_reference. before calling convert_to_reference.
......
...@@ -3184,10 +3184,6 @@ typedef enum base_kind { ...@@ -3184,10 +3184,6 @@ typedef enum base_kind {
binfo. */ binfo. */
} base_kind; } base_kind;
/* in decl{2}.c */
/* A node that is a list (length 1) of error_mark_nodes. */
extern GTY(()) tree error_mark_list;
/* Node for "pointer to (virtual) function". /* Node for "pointer to (virtual) function".
This may be distinct from ptr_type_node so gdb can distinguish them. */ This may be distinct from ptr_type_node so gdb can distinguish them. */
#define vfunc_ptr_type_node vtable_entry_type #define vfunc_ptr_type_node vtable_entry_type
......
...@@ -106,9 +106,6 @@ static void initialize_local_var (tree, tree); ...@@ -106,9 +106,6 @@ static void initialize_local_var (tree, tree);
static void expand_static_init (tree, tree); static void expand_static_init (tree, tree);
static tree next_initializable_field (tree); static tree next_initializable_field (tree);
/* Erroneous argument lists can use this *IFF* they do not modify it. */
tree error_mark_list;
/* The following symbols are subsumed in the cp_global_trees array, and /* The following symbols are subsumed in the cp_global_trees array, and
listed here individually for documentation purposes. listed here individually for documentation purposes.
...@@ -3118,9 +3115,6 @@ cxx_init_decl_processing (void) ...@@ -3118,9 +3115,6 @@ cxx_init_decl_processing (void)
/* Initially, C. */ /* Initially, C. */
current_lang_name = lang_name_c; current_lang_name = lang_name_c;
error_mark_list = build_tree_list (error_mark_node, error_mark_node);
TREE_TYPE (error_mark_list) = error_mark_node;
/* Create the `std' namespace. */ /* Create the `std' namespace. */
push_namespace (std_identifier); push_namespace (std_identifier);
std_node = current_namespace; std_node = current_namespace;
......
...@@ -2787,7 +2787,7 @@ convert_arguments (tree typelist, tree values, tree fndecl, int flags) ...@@ -2787,7 +2787,7 @@ convert_arguments (tree typelist, tree values, tree fndecl, int flags)
} }
else else
error ("too few arguments to function"); error ("too few arguments to function");
return error_mark_list; return error_mark_node;
} }
} }
......
2006-04-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-04-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/26036
* g++.dg/expr/call3.C: New test.
PR c++/10385 PR c++/10385
* g++.dg/conversion/dynamic1.C: New test. * g++.dg/conversion/dynamic1.C: New test.
// PR c++/26036
// Origin: <ben@pc-doctor.com>
// { dg-do compile }
struct A
{
int i;
};
A foo(int); // { dg-error "too few arguments" }
int j = foo().i; // { dg-error "at this point" }
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