mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-31 09:20:44 +08:00
Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
* Make-lang.in (cp/lex.o): Do not depend on cp/lex.h. (cp/decl.o): Likewise. (cp/decl2.o): Likewise. (cp/pt.o): Likewise. (cp/semantics.o): Likewise. * config-lang.in (gtfiles): Do not reference cp/lex.h. * class.c: Do not include lex.h. (add_implicitly_declared_members): Do not use adding_implicit_members. (check_bases_and_members): Do not talk about grok_x_components. * cp/cp-tree.h (adding_implicit_members): Remove. (cp_storage_class): New type. (cp_decl_spec): Likewise. (cp_decl_specifier_seq): Likewise. (cp_parameter_declarator): Use it for the decl_specifiers field. (check_tag_decl): Adjust prototype. (shadow_tag): Likewise. (groktypename): Likewise. (start_decl): Likewise. (start_function): Likewise. (start_method): Likewise. (grok_x_components): Remove. (grokfield): Adjust prototype. (grokbitfield): Likewise. (finish_member_class_template): Remove. * decl.c: Do not include lex.h. (adding_implicit_members): Do not define. (check_tag_decl): Do not use trees to represent decl-specifiers. (shadow_tag): Likewise. (groktypename): Likewise. (start_decl): Likewise. (grokvardecl): Likewise. (grokdeclarator): Likewise. (grokparms): Likewise. (start_function): Likewise. (start_method): Likewise. * decl.h (grokdeclarator): Adjust prototype. * decl2.c: Do not include lex.h. (grok_x_components): Remove. (grokfield): Do not use trees to represent decl-specifiers. (grokbitfield): Likewise. * lex.c: Do not include lex.h. * lex.h: Remove. * parser.c: Include target.h. (clear_decl_specs): New function. (cp_parser_translation_unit): Do not use trees to represent decl-specifiers. (cp_parser_postfix_expression): Likewise. (cp_parser_new_type_id): Likewise. (cp_parser_condition): Likewise. (cp_parser_simple_declaration): Likewise. (cp_parser_decl_specifier_seq): Likewise. (cp_parser_function_specifier_opt): Likewise. (cp_parser_conversion_type_id): Likewise. (cp_parser_template_parameter): Likewise. (cp_parser_explicit_instantiation): Likewise. (cp_parser_type_specifier): Likewise. (cp_parser_simple_type_specifier): Likewise. (cp_parser_init_declarator): Likewise. (cp_parser_type_id): Likewise. (cp_parser_type_specifier_seq): Likewise. (cp_parser_parameter_declaration): Likewise. (cp_parser_member_declaration): Likewise. (cp_parser_exception_declaration): Likewise. (cp_parser_function_definition_from_specifiers_and_declarator): Likewise. (cp_parser_single_declaration): Likewise. (cp_parser_save_member_function_body): Likewise. (cp_parser_friend_p): Likewise. (cp_parser_set_storage_class): New function. (cp_parser_set_decl_spec_type): Likewise. * pt.c: Do not include lex.h. * semantics.c: Likewise. (finish_member_class_template): Remove. From-SVN: r83584
This commit is contained in:
parent
3a4d587b32
commit
62d1db179e
@ -1,3 +1,80 @@
|
||||
2004-06-23 Mark Mitchell <mark@codesourcery.com>
|
||||
|
||||
* Make-lang.in (cp/lex.o): Do not depend on cp/lex.h.
|
||||
(cp/decl.o): Likewise.
|
||||
(cp/decl2.o): Likewise.
|
||||
(cp/pt.o): Likewise.
|
||||
(cp/semantics.o): Likewise.
|
||||
* config-lang.in (gtfiles): Do not reference cp/lex.h.
|
||||
* class.c: Do not include lex.h.
|
||||
(add_implicitly_declared_members): Do not use
|
||||
adding_implicit_members.
|
||||
(check_bases_and_members): Do not talk about grok_x_components.
|
||||
* cp/cp-tree.h (adding_implicit_members): Remove.
|
||||
(cp_storage_class): New type.
|
||||
(cp_decl_spec): Likewise.
|
||||
(cp_decl_specifier_seq): Likewise.
|
||||
(cp_parameter_declarator): Use it for the decl_specifiers field.
|
||||
(check_tag_decl): Adjust prototype.
|
||||
(shadow_tag): Likewise.
|
||||
(groktypename): Likewise.
|
||||
(start_decl): Likewise.
|
||||
(start_function): Likewise.
|
||||
(start_method): Likewise.
|
||||
(grok_x_components): Remove.
|
||||
(grokfield): Adjust prototype.
|
||||
(grokbitfield): Likewise.
|
||||
(finish_member_class_template): Remove.
|
||||
* decl.c: Do not include lex.h.
|
||||
(adding_implicit_members): Do not define.
|
||||
(check_tag_decl): Do not use trees to represent decl-specifiers.
|
||||
(shadow_tag): Likewise.
|
||||
(groktypename): Likewise.
|
||||
(start_decl): Likewise.
|
||||
(grokvardecl): Likewise.
|
||||
(grokdeclarator): Likewise.
|
||||
(grokparms): Likewise.
|
||||
(start_function): Likewise.
|
||||
(start_method): Likewise.
|
||||
* decl.h (grokdeclarator): Adjust prototype.
|
||||
* decl2.c: Do not include lex.h.
|
||||
(grok_x_components): Remove.
|
||||
(grokfield): Do not use trees to represent decl-specifiers.
|
||||
(grokbitfield): Likewise.
|
||||
* lex.c: Do not include lex.h.
|
||||
* lex.h: Remove.
|
||||
* parser.c: Include target.h.
|
||||
(clear_decl_specs): New function.
|
||||
(cp_parser_translation_unit): Do not use trees to represent
|
||||
decl-specifiers.
|
||||
(cp_parser_postfix_expression): Likewise.
|
||||
(cp_parser_new_type_id): Likewise.
|
||||
(cp_parser_condition): Likewise.
|
||||
(cp_parser_simple_declaration): Likewise.
|
||||
(cp_parser_decl_specifier_seq): Likewise.
|
||||
(cp_parser_function_specifier_opt): Likewise.
|
||||
(cp_parser_conversion_type_id): Likewise.
|
||||
(cp_parser_template_parameter): Likewise.
|
||||
(cp_parser_explicit_instantiation): Likewise.
|
||||
(cp_parser_type_specifier): Likewise.
|
||||
(cp_parser_simple_type_specifier): Likewise.
|
||||
(cp_parser_init_declarator): Likewise.
|
||||
(cp_parser_type_id): Likewise.
|
||||
(cp_parser_type_specifier_seq): Likewise.
|
||||
(cp_parser_parameter_declaration): Likewise.
|
||||
(cp_parser_member_declaration): Likewise.
|
||||
(cp_parser_exception_declaration): Likewise.
|
||||
(cp_parser_function_definition_from_specifiers_and_declarator):
|
||||
Likewise.
|
||||
(cp_parser_single_declaration): Likewise.
|
||||
(cp_parser_save_member_function_body): Likewise.
|
||||
(cp_parser_friend_p): Likewise.
|
||||
(cp_parser_set_storage_class): New function.
|
||||
(cp_parser_set_decl_spec_type): Likewise.
|
||||
* pt.c: Do not include lex.h.
|
||||
* semantics.c: Likewise.
|
||||
(finish_member_class_template): Remove.
|
||||
|
||||
2004-06-23 Roger Sayle <roger@eyesopen.com>
|
||||
|
||||
* call.c (build_cxx_call): Don't call expand_tree_builtin. No
|
||||
|
@ -216,15 +216,15 @@ CXX_TREE_H = $(TREE_H) cp/name-lookup.h cp/cp-tree.h c-common.h \
|
||||
|
||||
CXX_PRETTY_PRINT_H = cp/cxx-pretty-print.h $(C_PRETTY_PRINT_H)
|
||||
|
||||
cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h \
|
||||
cp/lex.o: cp/lex.c $(CXX_TREE_H) $(TM_H) flags.h \
|
||||
c-pragma.h toplev.h output.h input.h cp/operators.def $(TM_P_H)
|
||||
cp/cp-lang.o: cp/cp-lang.c $(CXX_TREE_H) $(TM_H) toplev.h langhooks.h \
|
||||
$(LANGHOOKS_DEF_H) c-common.h $(CXX_PRETTY_PRINT_H) $(DIAGNOSTIC_H)
|
||||
cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h cp/decl.h stack.h \
|
||||
cp/decl.o: cp/decl.c $(CXX_TREE_H) $(TM_H) flags.h cp/decl.h stack.h \
|
||||
output.h $(EXPR_H) except.h toplev.h $(HASHTAB_H) $(RTL_H) \
|
||||
cp/operators.def $(TM_P_H) tree-inline.h diagnostic.h c-pragma.h \
|
||||
debug.h gt-cp-decl.h gtype-cp.h timevar.h $(TREE_FLOW_H)
|
||||
cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) flags.h cp/lex.h cp/decl.h $(EXPR_H) \
|
||||
cp/decl2.o: cp/decl2.c $(CXX_TREE_H) $(TM_H) flags.h cp/decl.h $(EXPR_H) \
|
||||
output.h except.h toplev.h $(RTL_H) c-common.h gt-cp-decl2.h cgraph.h
|
||||
cp/typeck2.o: cp/typeck2.c $(CXX_TREE_H) $(TM_H) flags.h toplev.h output.h $(TM_P_H) \
|
||||
diagnostic.h
|
||||
@ -248,13 +248,13 @@ cp/except.o: cp/except.c $(CXX_TREE_H) $(TM_H) flags.h $(RTL_H) except.h toplev.
|
||||
cp/cfns.h $(EXPR_H) libfuncs.h tree-inline.h
|
||||
cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) flags.h $(EXPR_H) toplev.h \
|
||||
except.h $(TM_P_H)
|
||||
cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/lex.h \
|
||||
cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h \
|
||||
toplev.h $(RTL_H) except.h tree-inline.h gt-cp-pt.h
|
||||
cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \
|
||||
flags.h real.h $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H)
|
||||
cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h diagnostic.h \
|
||||
gt-cp-repo.h
|
||||
cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) cp/lex.h except.h toplev.h \
|
||||
cp/semantics.o: cp/semantics.c $(CXX_TREE_H) $(TM_H) except.h toplev.h \
|
||||
flags.h debug.h output.h $(RTL_H) $(TIMEVAR_H) $(EXPR_H) \
|
||||
tree-inline.h cgraph.h
|
||||
cp/dump.o: cp/dump.c $(CXX_TREE_H) $(TM_H) tree-dump.h
|
||||
|
@ -33,7 +33,6 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "rtl.h"
|
||||
#include "output.h"
|
||||
#include "toplev.h"
|
||||
#include "lex.h"
|
||||
#include "target.h"
|
||||
#include "convert.h"
|
||||
|
||||
@ -2624,8 +2623,6 @@ add_implicitly_declared_members (tree t,
|
||||
tree virtual_dtor = NULL_TREE;
|
||||
tree *f;
|
||||
|
||||
++adding_implicit_members;
|
||||
|
||||
/* Destructor. */
|
||||
if (TYPE_HAS_NONTRIVIAL_DESTRUCTOR (t) && !TYPE_HAS_DESTRUCTOR (t))
|
||||
{
|
||||
@ -2700,8 +2697,6 @@ add_implicitly_declared_members (tree t,
|
||||
*f = TYPE_METHODS (t);
|
||||
TYPE_METHODS (t) = implicit_fns;
|
||||
}
|
||||
|
||||
--adding_implicit_members;
|
||||
}
|
||||
|
||||
/* Subroutine of finish_struct_1. Recursively count the number of fields
|
||||
@ -4206,8 +4201,7 @@ check_bases_and_members (tree t)
|
||||
TYPE_HAS_COMPLEX_ASSIGN_REF (t)
|
||||
|= TYPE_HAS_ASSIGN_REF (t) || TYPE_CONTAINS_VPTR_P (t);
|
||||
|
||||
/* Synthesize any needed methods. Note that methods will be synthesized
|
||||
for anonymous unions; grok_x_components undoes that. */
|
||||
/* Synthesize any needed methods. */
|
||||
add_implicitly_declared_members (t, cant_have_default_ctor,
|
||||
cant_have_const_ctor,
|
||||
no_const_asn_ref);
|
||||
|
@ -34,4 +34,4 @@ stagestuff="g++\$(exeext) g++-cross\$(exeext) cc1plus\$(exeext)"
|
||||
|
||||
target_libs="target-libstdc++-v3 target-gperf"
|
||||
|
||||
gtfiles="\$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/lex.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-lex.c \$(srcdir)/c-pragma.c"
|
||||
gtfiles="\$(srcdir)/cp/mangle.c \$(srcdir)/cp/name-lookup.h \$(srcdir)/cp/name-lookup.c \$(srcdir)/cp/cp-tree.h \$(srcdir)/cp/decl.h \$(srcdir)/cp/call.c \$(srcdir)/cp/decl.c \$(srcdir)/cp/decl2.c \$(srcdir)/cp/pt.c \$(srcdir)/cp/repo.c \$(srcdir)/cp/semantics.c \$(srcdir)/cp/tree.c \$(srcdir)/cp/parser.c \$(srcdir)/cp/method.c \$(srcdir)/c-common.c \$(srcdir)/c-common.h \$(srcdir)/c-lex.c \$(srcdir)/c-pragma.c"
|
||||
|
@ -3082,11 +3082,6 @@ typedef enum base_kind {
|
||||
binfo. */
|
||||
} base_kind;
|
||||
|
||||
/* Set by add_implicitly_declared_members() to keep those members from
|
||||
being flagged as deprecated or reported as using deprecated
|
||||
types. */
|
||||
extern int adding_implicit_members;
|
||||
|
||||
/* in decl{2}.c */
|
||||
/* A node that is a list (length 1) of error_mark_nodes. */
|
||||
extern GTY(()) tree error_mark_list;
|
||||
@ -3508,6 +3503,74 @@ extern GTY(()) operator_name_info_t operator_name_info
|
||||
extern GTY(()) operator_name_info_t assignment_operator_name_info
|
||||
[(int) LAST_CPLUS_TREE_CODE];
|
||||
|
||||
/* A storage class. */
|
||||
|
||||
typedef enum cp_storage_class {
|
||||
/* sc_none must be zero so that zeroing a cp_decl_specifier_seq
|
||||
sets the storage_class field to sc_none. */
|
||||
sc_none = 0,
|
||||
sc_auto,
|
||||
sc_register,
|
||||
sc_static,
|
||||
sc_extern,
|
||||
sc_mutable,
|
||||
} cp_storage_class;
|
||||
|
||||
/* An individual decl-specifier. */
|
||||
|
||||
typedef enum cp_decl_spec {
|
||||
ds_first,
|
||||
ds_signed = ds_first,
|
||||
ds_unsigned,
|
||||
ds_short,
|
||||
ds_long,
|
||||
ds_const,
|
||||
ds_volatile,
|
||||
ds_restrict,
|
||||
ds_inline,
|
||||
ds_virtual,
|
||||
ds_explicit,
|
||||
ds_friend,
|
||||
ds_typedef,
|
||||
ds_complex,
|
||||
ds_thread,
|
||||
ds_last
|
||||
} cp_decl_spec;
|
||||
|
||||
/* A decl-specifier-seq. */
|
||||
|
||||
typedef struct cp_decl_specifier_seq {
|
||||
/* The number of times each of the keywords has been seen. */
|
||||
unsigned specs[(int) ds_last];
|
||||
/* The primary type, if any, given by the decl-specifier-seq.
|
||||
Modifiers, like "short", "const", and "unsigned" are not
|
||||
reflected here. This field will be a TYPE, unless a typedef-name
|
||||
was used, in which case it will be a TYPE_DECL. */
|
||||
tree type;
|
||||
/* The attributes, if any, provided with the specifier sequence. */
|
||||
tree attributes;
|
||||
/* If non-NULL, a built-in type that the user attempted to redefine
|
||||
to some other type. */
|
||||
tree redefined_builtin_type;
|
||||
/* The storage class specified -- or sc_none if no storage class was
|
||||
explicitly specified. */
|
||||
cp_storage_class storage_class;
|
||||
/* True iff TYPE_SPEC indicates a user-defined type. */
|
||||
BOOL_BITFIELD user_defined_type_p : 1;
|
||||
/* True iff multiple types were (erroneously) specified for this
|
||||
decl-specifier-seq. */
|
||||
BOOL_BITFIELD multiple_types_p : 1;
|
||||
/* True iff multiple storage classes were (erroneously) specified
|
||||
for this decl-specifier-seq. */
|
||||
BOOL_BITFIELD multiple_storage_classes_p : 1;
|
||||
/* True iff at least one decl-specifier was found. */
|
||||
BOOL_BITFIELD any_specifiers_p : 1;
|
||||
/* True iff "int" was explicitly provided. */
|
||||
BOOL_BITFIELD explicit_int_p : 1;
|
||||
/* True iff "char" was explicitly provided. */
|
||||
BOOL_BITFIELD explicit_char_p : 1;
|
||||
} cp_decl_specifier_seq;
|
||||
|
||||
/* The various kinds of declarators. */
|
||||
|
||||
typedef enum cp_declarator_kind {
|
||||
@ -3531,7 +3594,7 @@ struct cp_parameter_declarator {
|
||||
/* The next parameter, or NULL_TREE if none. */
|
||||
cp_parameter_declarator *next;
|
||||
/* The decl-specifiers-seq for the parameter. */
|
||||
tree decl_specifiers;
|
||||
cp_decl_specifier_seq decl_specifiers;
|
||||
/* The declarator for the parameter. */
|
||||
cp_declarator *declarator;
|
||||
/* The default-argument expression, or NULL_TREE, if none. */
|
||||
@ -3735,10 +3798,10 @@ extern tree push_library_fn (tree, tree);
|
||||
extern tree push_void_library_fn (tree, tree);
|
||||
extern tree push_throw_library_fn (tree, tree);
|
||||
extern int init_type_desc (void);
|
||||
extern tree check_tag_decl (tree);
|
||||
extern tree shadow_tag (tree);
|
||||
extern tree groktypename (tree, const cp_declarator *);
|
||||
extern tree start_decl (const cp_declarator *, tree, int, tree, tree);
|
||||
extern tree check_tag_decl (cp_decl_specifier_seq *);
|
||||
extern tree shadow_tag (cp_decl_specifier_seq *);
|
||||
extern tree groktypename (cp_decl_specifier_seq *, const cp_declarator *);
|
||||
extern tree start_decl (const cp_declarator *, cp_decl_specifier_seq *, int, tree, tree);
|
||||
extern void start_decl_1 (tree);
|
||||
extern void cp_finish_decl (tree, tree, tree, int);
|
||||
extern void finish_decl (tree, tree, tree);
|
||||
@ -3759,11 +3822,11 @@ extern tree start_enum (tree);
|
||||
extern void finish_enum (tree);
|
||||
extern void build_enumerator (tree, tree, tree);
|
||||
extern void start_preparsed_function (tree, tree, int);
|
||||
extern int start_function (tree, const cp_declarator *, tree);
|
||||
extern int start_function (cp_decl_specifier_seq *, const cp_declarator *, tree);
|
||||
extern tree begin_function_body (void);
|
||||
extern void finish_function_body (tree);
|
||||
extern tree finish_function (int);
|
||||
extern tree start_method (tree, const cp_declarator *, tree);
|
||||
extern tree start_method (cp_decl_specifier_seq *, const cp_declarator *, tree);
|
||||
extern tree finish_method (tree);
|
||||
extern void maybe_register_incomplete_var (tree);
|
||||
extern void complete_vars (tree);
|
||||
@ -3804,7 +3867,6 @@ extern bool have_extern_spec;
|
||||
/* in decl2.c */
|
||||
extern bool check_java_method (tree);
|
||||
extern int grok_method_quals (tree, tree, tree);
|
||||
extern void grok_x_components (tree);
|
||||
extern void maybe_retrofit_in_chrg (tree);
|
||||
extern void maybe_make_one_only (tree);
|
||||
extern void grokclassfn (tree, tree, enum overload_flags, tree);
|
||||
@ -3812,8 +3874,8 @@ extern tree grok_array_decl (tree, tree);
|
||||
extern tree delete_sanity (tree, tree, bool, int);
|
||||
extern tree check_classfn (tree, tree, tree);
|
||||
extern void check_member_template (tree);
|
||||
extern tree grokfield (const cp_declarator *, tree, tree, tree, tree);
|
||||
extern tree grokbitfield (const cp_declarator *, tree, tree);
|
||||
extern tree grokfield (const cp_declarator *, cp_decl_specifier_seq *, tree, tree, tree);
|
||||
extern tree grokbitfield (const cp_declarator *, cp_decl_specifier_seq *, tree);
|
||||
extern tree groktypefield (tree, tree);
|
||||
extern void cplus_decl_attributes (tree *, tree, int);
|
||||
extern void finish_anon_union (tree);
|
||||
@ -4157,7 +4219,6 @@ extern tree finish_template_type_parm (tree, tree);
|
||||
extern tree finish_template_template_parm (tree, tree);
|
||||
extern tree begin_class_definition (tree);
|
||||
extern void finish_default_args (void);
|
||||
extern tree finish_member_class_template (tree);
|
||||
extern void finish_template_decl (tree);
|
||||
extern tree finish_template_type (tree, tree, int);
|
||||
extern tree finish_base_specifier (tree, tree, bool);
|
||||
|
616
gcc/cp/decl.c
616
gcc/cp/decl.c
File diff suppressed because it is too large
Load Diff
@ -31,7 +31,9 @@ enum decl_context
|
||||
};
|
||||
|
||||
/* We need this in here to get the decl_context definition. */
|
||||
extern tree grokdeclarator (const cp_declarator *, tree, enum decl_context, int, tree*);
|
||||
extern tree grokdeclarator (const cp_declarator *,
|
||||
cp_decl_specifier_seq *,
|
||||
enum decl_context, int, tree*);
|
||||
|
||||
#ifdef DEBUG_CP_BINDING_LEVELS
|
||||
/* Purely for debugging purposes. */
|
||||
|
@ -38,7 +38,6 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "flags.h"
|
||||
#include "cp-tree.h"
|
||||
#include "decl.h"
|
||||
#include "lex.h"
|
||||
#include "output.h"
|
||||
#include "except.h"
|
||||
#include "toplev.h"
|
||||
@ -157,27 +156,6 @@ grok_method_quals (tree ctype, tree function, tree quals)
|
||||
return this_quals;
|
||||
}
|
||||
|
||||
/* A subroutine of the parser, to handle a component list. */
|
||||
|
||||
void
|
||||
grok_x_components (tree specs)
|
||||
{
|
||||
tree t;
|
||||
|
||||
specs = strip_attrs (specs);
|
||||
|
||||
check_tag_decl (specs);
|
||||
t = groktypename (specs, /*declarator=*/NULL);
|
||||
|
||||
/* The only case where we need to do anything additional here is an
|
||||
anonymous union field, e.g.: `struct S { union { int i; }; };'. */
|
||||
if (t == NULL_TREE || !ANON_AGGR_TYPE_P (t))
|
||||
return;
|
||||
|
||||
fixup_anonymous_aggr (t);
|
||||
finish_member_declaration (build_decl (FIELD_DECL, NULL_TREE, t));
|
||||
}
|
||||
|
||||
/* Build a PARM_DECL with NAME and TYPE, and set DECL_ARG_TYPE
|
||||
appropriately. */
|
||||
|
||||
@ -840,7 +818,8 @@ finish_static_data_member_decl (tree decl, tree init, tree asmspec_tree,
|
||||
CHANGES TO CODE IN `start_method'. */
|
||||
|
||||
tree
|
||||
grokfield (const cp_declarator *declarator, tree declspecs,
|
||||
grokfield (const cp_declarator *declarator,
|
||||
cp_decl_specifier_seq *declspecs,
|
||||
tree init, tree asmspec_tree,
|
||||
tree attrlist)
|
||||
{
|
||||
@ -848,7 +827,7 @@ grokfield (const cp_declarator *declarator, tree declspecs,
|
||||
const char *asmspec = 0;
|
||||
int flags = LOOKUP_ONLYCONVERTING;
|
||||
|
||||
if (declspecs == NULL_TREE
|
||||
if (!declspecs->any_specifiers_p
|
||||
&& declarator->kind == cdk_id
|
||||
&& TREE_CODE (declarator->u.id.name) == SCOPE_REF
|
||||
&& (TREE_CODE (TREE_OPERAND (declarator->u.id.name, 1))
|
||||
@ -1023,7 +1002,8 @@ grokfield (const cp_declarator *declarator, tree declspecs,
|
||||
WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node. */
|
||||
|
||||
tree
|
||||
grokbitfield (const cp_declarator *declarator, tree declspecs, tree width)
|
||||
grokbitfield (const cp_declarator *declarator,
|
||||
cp_decl_specifier_seq *declspecs, tree width)
|
||||
{
|
||||
tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, NULL);
|
||||
|
||||
|
@ -31,7 +31,6 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "tree.h"
|
||||
#include "cp-tree.h"
|
||||
#include "cpplib.h"
|
||||
#include "lex.h"
|
||||
#include "flags.h"
|
||||
#include "c-pragma.h"
|
||||
#include "toplev.h"
|
||||
|
68
gcc/cp/lex.h
68
gcc/cp/lex.h
@ -1,68 +0,0 @@
|
||||
/* Define constants and variables for communication with the parser.
|
||||
Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
|
||||
2000, 2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
Hacked by Michael Tiemann (tiemann@cygnus.com)
|
||||
and by Brendan Kehoe (brendan@cygnus.com).
|
||||
|
||||
This file is part of GCC.
|
||||
|
||||
GCC is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GCC is distributed in the hope that it will be useful, but
|
||||
WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GCC; see the file COPYING. If not, write to the Free
|
||||
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
||||
02111-1307, USA. */
|
||||
|
||||
|
||||
#ifndef GCC_CP_LEX_H
|
||||
#define GCC_CP_LEX_H
|
||||
|
||||
#if 0
|
||||
/* Formerly, the RID_* values used as mask bits did not fit into a
|
||||
single 32-bit word. Now they do, but let's preserve the old logic
|
||||
in case they ever stop fitting again. -zw, 8 Aug 2000 */
|
||||
|
||||
/* The type that can represent all values of RIDBIT. */
|
||||
/* We assume that we can stick in at least 32 bits into this. */
|
||||
typedef struct { unsigned long idata[2]; }
|
||||
RID_BIT_TYPE;
|
||||
|
||||
/* Be careful, all these modify N twice. */
|
||||
#define RIDBIT_SETP(N, V) (((unsigned long)1 << (int) ((N)%32)) \
|
||||
& (V).idata[(N)/32])
|
||||
#define RIDBIT_NOTSETP(NN, VV) (! RIDBIT_SETP (NN, VV))
|
||||
#define RIDBIT_SET(N, V) do { \
|
||||
(V).idata[(N)/32] \
|
||||
|= ((unsigned long)1 << (int) ((N)%32)); \
|
||||
} while (0)
|
||||
#define RIDBIT_RESET(N, V) do { \
|
||||
(V).idata[(N)/32] \
|
||||
&= ~((unsigned long)1 << (int) ((N)%32)); \
|
||||
} while (0)
|
||||
#define RIDBIT_RESET_ALL(V) do { \
|
||||
(V).idata[0] = 0; \
|
||||
(V).idata[1] = 0; \
|
||||
} while (0)
|
||||
#define RIDBIT_ANY_SET(V) ((V).idata[0] || (V).idata[1])
|
||||
#else
|
||||
typedef unsigned long RID_BIT_TYPE; /* assumed at least 32 bits */
|
||||
#define RIDBIT_OF(R) ((unsigned long)1 << (int) (R))
|
||||
|
||||
#define RIDBIT_SETP(N, V) ((V) & RIDBIT_OF (N))
|
||||
#define RIDBIT_NOTSETP(N, V) (! ((V) & RIDBIT_OF (N)))
|
||||
#define RIDBIT_ANY_SET(V) (V)
|
||||
|
||||
#define RIDBIT_SET(N, V) do { (V) |= RIDBIT_OF (N); } while (0)
|
||||
#define RIDBIT_RESET(N, V) do { (V) &= ~RIDBIT_OF (N); } while (0)
|
||||
#define RIDBIT_RESET_ALL(V) do { (V) = 0; } while (0)
|
||||
#endif
|
||||
|
||||
#endif /* ! GCC_CP_LEX_H */
|
651
gcc/cp/parser.c
651
gcc/cp/parser.c
File diff suppressed because it is too large
Load Diff
@ -36,7 +36,6 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "cp-tree.h"
|
||||
#include "tree-inline.h"
|
||||
#include "decl.h"
|
||||
#include "lex.h"
|
||||
#include "output.h"
|
||||
#include "except.h"
|
||||
#include "toplev.h"
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "tree-inline.h"
|
||||
#include "tree-mudflap.h"
|
||||
#include "except.h"
|
||||
#include "lex.h"
|
||||
#include "toplev.h"
|
||||
#include "flags.h"
|
||||
#include "rtl.h"
|
||||
@ -2147,36 +2146,6 @@ finish_member_declaration (tree decl)
|
||||
}
|
||||
}
|
||||
|
||||
/* Finish processing the declaration of a member class template
|
||||
TYPES whose template parameters are given by PARMS. */
|
||||
|
||||
tree
|
||||
finish_member_class_template (tree types)
|
||||
{
|
||||
tree t;
|
||||
|
||||
/* If there are declared, but undefined, partial specializations
|
||||
mixed in with the typespecs they will not yet have passed through
|
||||
maybe_process_partial_specialization, so we do that here. */
|
||||
for (t = types; t != NULL_TREE; t = TREE_CHAIN (t))
|
||||
if (IS_AGGR_TYPE_CODE (TREE_CODE (TREE_VALUE (t))))
|
||||
maybe_process_partial_specialization (TREE_VALUE (t));
|
||||
|
||||
grok_x_components (types);
|
||||
if (TYPE_CONTEXT (TREE_VALUE (types)) != current_class_type)
|
||||
/* The component was in fact a friend declaration. We avoid
|
||||
finish_member_template_decl performing certain checks by
|
||||
unsetting TYPES. */
|
||||
types = NULL_TREE;
|
||||
|
||||
finish_member_template_decl (types);
|
||||
|
||||
/* As with other component type declarations, we do
|
||||
not store the new DECL on the list of
|
||||
component_decls. */
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
/* Finish processing a complete template declaration. The PARMS are
|
||||
the template parameters. */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user