aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/cp-tree.h4
-rw-r--r--gcc/cp/decl.c6
-rw-r--r--gcc/cp/typeck.c2
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/g++.dg/expr/call3.C12
6 files changed, 23 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 27d31ba..aa5b60e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,12 @@
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
* rtti.c (build_dynamic_cast_1): Check for invalid conversions
before calling convert_to_reference.
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index f82ab32..0848747 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -3184,10 +3184,6 @@ typedef enum base_kind {
binfo. */
} 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".
This may be distinct from ptr_type_node so gdb can distinguish them. */
#define vfunc_ptr_type_node vtable_entry_type
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 9e101c1..215371a 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -106,9 +106,6 @@ static void initialize_local_var (tree, tree);
static void expand_static_init (tree, 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
listed here individually for documentation purposes.
@@ -3118,9 +3115,6 @@ cxx_init_decl_processing (void)
/* Initially, 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. */
push_namespace (std_identifier);
std_node = current_namespace;
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 6ee84a1..a7bdd55 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -2787,7 +2787,7 @@ convert_arguments (tree typelist, tree values, tree fndecl, int flags)
}
else
error ("too few arguments to function");
- return error_mark_list;
+ return error_mark_node;
}
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index d88b8c8..0e0367b 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2006-04-19 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+ PR c++/26036
+ * g++.dg/expr/call3.C: New test.
+
PR c++/10385
* g++.dg/conversion/dynamic1.C: New test.
diff --git a/gcc/testsuite/g++.dg/expr/call3.C b/gcc/testsuite/g++.dg/expr/call3.C
new file mode 100644
index 0000000..01f354a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/call3.C
@@ -0,0 +1,12 @@
+// 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" }