diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 03c02c4ef599816ac80efa8ee378bf2912dc7410..7e74f47b3b505b6690f02f3039d94cc451b5db51 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,11 @@ +2003-06-11 Mark Mitchell <mark@codesourcery.com> + + PR c++/10432 + * cp-tree.h (finish_declarator): Remove. + * decl.c (cp_finish_decl): Make sure to pop_nested_class even for + erroneous declarations. + * semantics.c (finish_declarator): Remove. + 2003-06-11 Roger Sayle <roger@eyesopen.com> * decl2.c (generate_ctor_or_dtor_function): Avoid expanding a diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h index 4639e174ee0f8224e0461d7e09b5f781a6de8ccc..244eb1a3add3bd1987b193ca503de9bfa20c3127 100644 --- a/gcc/cp/cp-tree.h +++ b/gcc/cp/cp-tree.h @@ -4118,7 +4118,6 @@ extern tree finish_unary_op_expr (enum tree_code, tree); extern tree finish_compound_literal (tree, tree); extern tree finish_fname (tree); extern int begin_function_definition (tree, tree, tree); -extern tree finish_declarator (tree, tree, tree, tree, int); extern void finish_translation_unit (void); extern tree finish_template_type_parm (tree, tree); extern tree finish_template_template_parm (tree, tree); diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1340640bc22001021da942f4caf5a38295069b99..f318551e25c97dbfb293c09b3d2a4a757e68733c 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8023,7 +8023,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) type = TREE_TYPE (decl); if (type == error_mark_node) - return; + goto finish_end0; if (TYPE_HAS_MUTABLE_P (type)) TREE_READONLY (decl) = 0; diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c index be524bef5ddce8a0fd5165ee29a5f6becf78bfd3..646cc19d525228aedbd1b541ae78dc0b5ae161e4 100644 --- a/gcc/cp/semantics.c +++ b/gcc/cp/semantics.c @@ -1739,21 +1739,6 @@ begin_function_definition (decl_specs, attributes, declarator) return 1; } -/* Finish an init-declarator. Returns a DECL. */ - -tree -finish_declarator (declarator, declspecs, attributes, - prefix_attributes, initialized) - tree declarator; - tree declspecs; - tree attributes; - tree prefix_attributes; - int initialized; -{ - return start_decl (declarator, declspecs, initialized, attributes, - prefix_attributes); -} - /* Finish a translation unit. */ void diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f5ca84ba9144bd745e1bfbcaab6cb74c19946615..52b54cb4857fdd681deef5abd448041ce4cc75cd 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-06-11 Mark Mitchell <mark@codesourcery.com> + + PR c++/10432 + * g++.dg/parse/error1.C: New test. + 2003-06-11 Janis Johnson <janis187@us.ibm.com> * gcc.dg/compat/struct-by-value-11_main.c: New file. diff --git a/gcc/testsuite/g++.dg/parse/error1.C b/gcc/testsuite/g++.dg/parse/error1.C new file mode 100644 index 0000000000000000000000000000000000000000..8756df64592177270927048aa41e410f3bd5f1b9 --- /dev/null +++ b/gcc/testsuite/g++.dg/parse/error1.C @@ -0,0 +1,6 @@ +struct INCOMPLETE; +template <int> struct X { + static INCOMPLETE value; +}; +template <> INCOMPLETE X<1>::value = 0; // { dg-error "" } +