diff options
author | Mark Mitchell <mark@codesourcery.com> | 2003-08-12 22:26:25 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 2003-08-12 22:26:25 +0000 |
commit | 560ad596bdde2ca44f9890e9e1399b29736c63ea (patch) | |
tree | 98aa4b6b847333e82f9374a9201eb1371ef7d159 /gcc/cp/decl.c | |
parent | 35e6511a747ac8fd49a70401ba99857b57c16e5c (diff) | |
download | gcc-560ad596bdde2ca44f9890e9e1399b29736c63ea.zip gcc-560ad596bdde2ca44f9890e9e1399b29736c63ea.tar.gz gcc-560ad596bdde2ca44f9890e9e1399b29736c63ea.tar.bz2 |
re PR c++/11703 (Problem with using enum in placement delete)
PR c++/11703
* call.c (type_passed_as): Use TYPE_SIZE, not TYPE_PRECISION to
determine whether or not to promote types.
(convert_for_arg_passing): Likewise.
* decl2.c (cp_build_parm_decl): Do not set DECL_ARG_TYPE in
templates.
* pt.c (tsubst_decl): Do not expect it to be set.
PR c++/9512
PR c++/10923
* cp-tree.h (check_elaborated_type_specifier): Declare.
(handle_class_head): Remove.
(note_got_semicolon): Likewise.
(note_list_got_semicolon): Likewise.
(finish_class_definition): Likewise.
* decl.c (check_elaborated_type_specifier): Make it public.
Robustify.
(handle_class_head): Remove.
* parser.c (cp_parser_elaborated_type_specifier): Use
check_elaborated_type_specifier.
(cp_parser_class_specifier): Do not call finish_class_definition.
(cp_parser_class_head): Or handle_class_head. Check for
over-qualified names.
* semantics.c (finish_class_definition): Remove.
* parser.c (cp_parser_check_for_definition_in_return_type): New
function.
(cp_parser_simple_declaration): Adjust call to
cp_parser_init_declarator.
(cp_parser_decl_specifier_seq): Change type of
declares_class_or_enum parameter.
(cp_parser_explicit_instantiation): Adjust accordingly.
(cp_parser_type_specifier): Change type of
declares_class_or_enum parameter.
(cp_parser_init_declarator): Add declares_class_or_enum
parameter.
(cp_parser_parameter_declaration): Adjust call to
cp_parser_decl_specifier_seq.
(cp_parser_function_definition): Likewise.
(cp_parser_member_declaration): Likewise.
(cp_parser_single_declaration): Likewise.
* cp-tree.h (lang_type_class): Remove has_call_overloaded,
has_array_ref_overloaded, has_arrow_overloaded, and got_semicolon.
(TYPE_OVERLOADS_CALL_EXPR): Remove.
(TYPE_OVERLOADS_ARRAY_REF): Likewise.
(TYPE_OVERLOADS_ARROW): Likewise.
(CLASSTYPE_GOT_SEMICOLON): Likewise.
* class.c (check_bases): Do not set them.
(finish_struct_1): Likewise.
* decl.c (cp_finish_decl): Do not set CLASSTYPE_GOT_SEMICOLON.
(build_ptrmemfunc_type): Likewise.
(grok_op_properties): Do not set TYPE_OVERLOADS_*.
(start_function): Do not check CLASSTYPE_GOT_SEMICOLON.
* decl2.c (grokfield): Do not set CLASSTYPE_GOT_SEMICOLON.
* lex.c (note_got_semicolon): Remove.
(note_list_got_semicolon): Likewise.
* parser.c (cp_parser_simple_declaration): Do not call
note_list_got_semicolon.
* pt.c (list_eq): Remove.
(lookup_template_class): Do not set CLASSTYPE_GOT_SEMICOLON.
(instantiate_class_template): Do not set TYPE_OVERLOADS*.
(instantiate_class_template): Do not set CLASSTYPE_GOT_SEMICOLON.
* ptree.c (cxx_print_type): Do not print them.
* semantics.c (finish_member_class_template): Do not call
note_list_got_semicolon.
* g++.dg/parse/ret-type2.C: New test.
PR c++/11703
* g++.dg/init/new8.C: New test.
PR c++/10923
* g++.dg/parse/typedef5.C: New test.
PR c++/9512
* g++.dg/parse/qualified2.C: New test.
* g++.old-deja/g++.other/decl5.C: Mark one more instance of
invalid code.
From-SVN: r70391
Diffstat (limited to 'gcc/cp/decl.c')
-rw-r--r-- | gcc/cp/decl.c | 37 |
1 files changed, 3 insertions, 34 deletions
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 9afa303..0619147 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8066,7 +8066,6 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags) if (TREE_TYPE (DECL_NAME (decl)) && TREE_TYPE (decl) != type) warning ("shadowing previous type declaration of `%#D'", decl); set_identifier_type_value (DECL_NAME (decl), type); - CLASSTYPE_GOT_SEMICOLON (type) = 1; } /* If we have installed this as the canonical typedef for this @@ -9245,9 +9244,6 @@ build_ptrmemfunc_type (tree type) later. */ TYPE_SET_PTRMEMFUNC_TYPE (type, t); - /* Seems to be wanted. */ - CLASSTYPE_GOT_SEMICOLON (t) = 1; - return t; } @@ -12241,19 +12237,6 @@ grok_op_properties (tree decl, int friendp) { switch (operator_code) { - case CALL_EXPR: - TYPE_OVERLOADS_CALL_EXPR (current_class_type) = 1; - break; - - case ARRAY_REF: - TYPE_OVERLOADS_ARRAY_REF (current_class_type) = 1; - break; - - case COMPONENT_REF: - case MEMBER_REF: - TYPE_OVERLOADS_ARROW (current_class_type) = 1; - break; - case NEW_EXPR: TYPE_HAS_NEW_OPERATOR (current_class_type) = 1; break; @@ -12541,7 +12524,7 @@ tag_name (enum tag_types code) error_mark_node; otherwise, return TYPE itself. If ALLOW_TEMPLATE_P is true, TYPE may be a class template. */ -static tree +tree check_elaborated_type_specifier (enum tag_types tag_code, tree type, bool allow_template_p) @@ -12553,8 +12536,8 @@ check_elaborated_type_specifier (enum tag_types tag_code, ill-formed. */ if (!t) { - error ("using typedef-name `%D' after `%s'", - TYPE_NAME (type), tag_name (tag_code)); + error ("using typedef-name `%T' after `%s'", + type, tag_name (tag_code)); t = error_mark_node; } else if (TREE_CODE (type) == TEMPLATE_TYPE_PARM) @@ -13412,20 +13395,6 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags) fntype = TREE_TYPE (decl1); restype = TREE_TYPE (fntype); - if (CLASS_TYPE_P (restype) && !CLASSTYPE_GOT_SEMICOLON (restype)) - { - error ("semicolon missing after declaration of `%#T'", restype); - shadow_tag (build_tree_list (NULL_TREE, restype)); - CLASSTYPE_GOT_SEMICOLON (restype) = 1; - if (TREE_CODE (fntype) == FUNCTION_TYPE) - fntype = build_function_type (integer_type_node, - TYPE_ARG_TYPES (fntype)); - else - fntype = build_cplus_method_type (build_type_variant (TYPE_METHOD_BASETYPE (fntype), TREE_READONLY (decl1), TREE_SIDE_EFFECTS (decl1)), - integer_type_node, - TYPE_ARG_TYPES (fntype)); - TREE_TYPE (decl1) = fntype; - } if (TREE_CODE (fntype) == METHOD_TYPE) ctype = TYPE_METHOD_BASETYPE (fntype); |