re PR c++/26036 (Treating a class object as a function with member variables causes...
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>
Wed, 19 Apr 2006 17:36:59 +0000 (17:36 +0000)
committerVolker Reichelt <reichelt@gcc.gnu.org>
Wed, 19 Apr 2006 17:36:59 +0000 (17:36 +0000)
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

gcc/cp/ChangeLog
gcc/cp/cp-tree.h
gcc/cp/decl.c
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/expr/call3.C [new file with mode: 0644]

index 27d31ba852a6c2f9f7f877eab9bc48fcaa952e67..aa5b60ec0d5c4510f094bb2ce8de6957fcc30952 100644 (file)
@@ -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.
index f82ab32f8d23613642eaeee3ca28cd3e7f344bc6..0848747687fceba430ef632e487bed6b57769cd2 100644 (file)
@@ -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
index 9e101c15eab84a125383a885f91bce0dd1df5eb6..215371a0f4ea767f7b05e59a75b341c9aad08e30 100644 (file)
@@ -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;
index 6ee84a112625e59909f4b1b09865ddbe558a9650..a7bdd55dcc7ee4e1dac48c6c5ef3e37ca91210a7 100644 (file)
@@ -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;
        }
     }
 
index d88b8c87745f4c67a7fa60932e5d2121bdb9934c..0e0367b99a06b4e455468cd1ce37b6dbbb1b2b7a 100644 (file)
@@ -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 (file)
index 0000000..01f354a
--- /dev/null
@@ -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" }