Commit 5362b086 by Eric Christopher

decl.c (init_decl_processing): Change definition of __wchar_t to wchar_t.

2000-11-07  Eric Christopher  <echristo@redhat.com>

        * decl.c (init_decl_processing): Change definition of
        __wchar_t to wchar_t.  Remove artificial declaration of
        wchar_t.
        * lex.c: Change instances of __wchar_t to wchar_t.

From-SVN: r37348
parent 7ca0e6d9
2000-11-07 Eric Christopher <echristo@redhat.com>
* decl.c (init_decl_processing): Change definition of
__wchar_t to wchar_t. Remove artificial declaration of
wchar_t.
* lex.c: Change instances of __wchar_t to wchar_t.
2000-11-09 Nathan Sidwell <nathan@codesourcery.com> 2000-11-09 Nathan Sidwell <nathan@codesourcery.com>
* lex.c (do_identifier): Don't lookup_name for operators. * lex.c (do_identifier): Don't lookup_name for operators.
...@@ -115,7 +122,7 @@ ...@@ -115,7 +122,7 @@
* error.c (dump_function_decl): Print no space between * error.c (dump_function_decl): Print no space between
`ptr-operator' the `type-specifier' of the return type. `ptr-operator' the `type-specifier' of the return type.
(dump_type_prefix): Make sure we put space at the appropriate (dump_type_prefix): Make sure we put space at the appropriate
place. place.
2000-10-23 Jason Merrill <jason@redhat.com> 2000-10-23 Jason Merrill <jason@redhat.com>
...@@ -134,7 +141,7 @@ ...@@ -134,7 +141,7 @@
* optimize.c (copy_body_r): Don't treat CALL_EXPRs specially. * optimize.c (copy_body_r): Don't treat CALL_EXPRs specially.
* typeck.c (c_sizeof): Return an expression of `size_t' type, * typeck.c (c_sizeof): Return an expression of `size_t' type,
not one with TYPE_IS_SIZETYPE set. not one with TYPE_IS_SIZETYPE set.
(dubious_conversion_warnings): Remove special-case code. (dubious_conversion_warnings): Remove special-case code.
...@@ -147,7 +154,7 @@ ...@@ -147,7 +154,7 @@
* tree.c (walk_tree): Handle VECTOR_TYPE. * tree.c (walk_tree): Handle VECTOR_TYPE.
* decl.c (init_decl_processing): Call MD_INIT_BUILTINS. * decl.c (init_decl_processing): Call MD_INIT_BUILTINS.
2000-10-21 Jason Merrill <jason@redhat.com> 2000-10-21 Jason Merrill <jason@redhat.com>
* parse.y (operator): Set got_object from got_scope. * parse.y (operator): Set got_object from got_scope.
...@@ -195,7 +202,7 @@ Fri Oct 20 13:54:59 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -195,7 +202,7 @@ Fri Oct 20 13:54:59 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
(splay_tree_compare_integer_csts): New function. (splay_tree_compare_integer_csts): New function.
(layout_class_type): Use a splay_tree, rather than a varray, to (layout_class_type): Use a splay_tree, rather than a varray, to
represent the offsets of empty bases. represent the offsets of empty bases.
* cp-tree.h (DECL_ANTICIPATED): Don't require a FUNCTION_DECL. * cp-tree.h (DECL_ANTICIPATED): Don't require a FUNCTION_DECL.
* decl.c (select_decl): Don't return declarations that are * decl.c (select_decl): Don't return declarations that are
DECL_ANTICIPATED. DECL_ANTICIPATED.
...@@ -227,7 +234,7 @@ Fri Oct 20 13:54:59 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> ...@@ -227,7 +234,7 @@ Fri Oct 20 13:54:59 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* except.c (init_exception_processing): Use std_identifier. * except.c (init_exception_processing): Use std_identifier.
* init.c (build_member_call): Use fake_std_node. * init.c (build_member_call): Use fake_std_node.
* rtti.c (init_rtti_processing): Use std_identifier. * rtti.c (init_rtti_processing): Use std_identifier.
2000-10-17 Mark Mitchell <mark@codesourcery.com> 2000-10-17 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (back_end_hook): Remove declaration. * cp-tree.h (back_end_hook): Remove declaration.
...@@ -295,7 +302,7 @@ Tue Oct 17 20:19:06 2000 Brad Lucier <lucier@math.purdue.edu> ...@@ -295,7 +302,7 @@ Tue Oct 17 20:19:06 2000 Brad Lucier <lucier@math.purdue.edu>
(init_repo): Initialize it. (init_repo): Initialize it.
* search.c (current_obstack): Remove. * search.c (current_obstack): Remove.
* typeck2.c (add_exception_specifier): Don't call build_decl_list. * typeck2.c (add_exception_specifier): Don't call build_decl_list.
2000-10-09 Richard Henderson <rth@cygnus.com> 2000-10-09 Richard Henderson <rth@cygnus.com>
* Make-lang.in (CXX_EXTRA_HEADERS): Remove. * Make-lang.in (CXX_EXTRA_HEADERS): Remove.
...@@ -331,7 +338,7 @@ Tue Oct 17 20:19:06 2000 Brad Lucier <lucier@math.purdue.edu> ...@@ -331,7 +338,7 @@ Tue Oct 17 20:19:06 2000 Brad Lucier <lucier@math.purdue.edu>
* pt.c (lookup_template_class): Set current access for enum. * pt.c (lookup_template_class): Set current access for enum.
(tsubst_enum): Set file & line for enum decl. (tsubst_enum): Set file & line for enum decl.
* spew.c (yylex): Remove unused variable. * spew.c (yylex): Remove unused variable.
2000-10-05 Richard Henderson <rth@cygnus.com> 2000-10-05 Richard Henderson <rth@cygnus.com>
...@@ -354,7 +361,7 @@ Tue Oct 17 20:19:06 2000 Brad Lucier <lucier@math.purdue.edu> ...@@ -354,7 +361,7 @@ Tue Oct 17 20:19:06 2000 Brad Lucier <lucier@math.purdue.edu>
2000-10-05 Nathan Sidwell <nathan@codesourcery.com> 2000-10-05 Nathan Sidwell <nathan@codesourcery.com>
* pt.c (tsubst_expr, DECL_STMT case): Don't process if * pt.c (tsubst_expr, DECL_STMT case): Don't process if
tsubsting fails. tsubsting fails.
2000-10-05 Nathan Sidwell <nathan@codesourcery.com> 2000-10-05 Nathan Sidwell <nathan@codesourcery.com>
...@@ -366,7 +373,7 @@ Tue Oct 17 20:19:06 2000 Brad Lucier <lucier@math.purdue.edu> ...@@ -366,7 +373,7 @@ Tue Oct 17 20:19:06 2000 Brad Lucier <lucier@math.purdue.edu>
* decl.c (lang_mark_false_label_stack): Remove. * decl.c (lang_mark_false_label_stack): Remove.
* lex.c (cp_mang_lang_type): Use ggc_alloc_cleared. * lex.c (cp_mang_lang_type): Use ggc_alloc_cleared.
2000-09-30 Joseph S. Myers <jsm28@cam.ac.uk> 2000-09-30 Joseph S. Myers <jsm28@cam.ac.uk>
* gxxint.texi: Use @email for formatting email addresses. * gxxint.texi: Use @email for formatting email addresses.
......
...@@ -188,7 +188,7 @@ static tree start_cleanup_fn PARAMS ((void)); ...@@ -188,7 +188,7 @@ static tree start_cleanup_fn PARAMS ((void));
static void end_cleanup_fn PARAMS ((void)); static void end_cleanup_fn PARAMS ((void));
static tree cp_make_fname_decl PARAMS ((tree, const char *, int)); static tree cp_make_fname_decl PARAMS ((tree, const char *, int));
static void initialize_predefined_identifiers PARAMS ((void)); static void initialize_predefined_identifiers PARAMS ((void));
static tree check_special_function_return_type static tree check_special_function_return_type
PARAMS ((special_function_kind, tree, tree, tree)); PARAMS ((special_function_kind, tree, tree, tree));
static tree push_cp_library_fn PARAMS ((enum tree_code, tree)); static tree push_cp_library_fn PARAMS ((enum tree_code, tree));
static tree build_cp_library_fn PARAMS ((tree, enum tree_code, tree)); static tree build_cp_library_fn PARAMS ((tree, enum tree_code, tree));
...@@ -491,7 +491,7 @@ struct binding_level ...@@ -491,7 +491,7 @@ struct binding_level
replaced with a TEMPLATE_DECL. */ replaced with a TEMPLATE_DECL. */
unsigned template_parms_p : 1; unsigned template_parms_p : 1;
/* Nonzero if this scope corresponds to the `<>' in a /* Nonzero if this scope corresponds to the `<>' in a
`template <>' clause. Whenever this flag is set, `template <>' clause. Whenever this flag is set,
TEMPLATE_PARMS_P will be set as well. */ TEMPLATE_PARMS_P will be set as well. */
unsigned template_spec_p : 1; unsigned template_spec_p : 1;
...@@ -2860,12 +2860,12 @@ pushtag (name, type, globalize) ...@@ -2860,12 +2860,12 @@ pushtag (name, type, globalize)
all function definitions in a translation unit in a convenient all function definitions in a translation unit in a convenient
way. (It's otherwise tricky to find a member function definition way. (It's otherwise tricky to find a member function definition
it's only pointed to from within a local class.) */ it's only pointed to from within a local class.) */
if (TYPE_CONTEXT (type) if (TYPE_CONTEXT (type)
&& TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL && TREE_CODE (TYPE_CONTEXT (type)) == FUNCTION_DECL
&& !processing_template_decl) && !processing_template_decl)
VARRAY_PUSH_TREE (local_classes, type); VARRAY_PUSH_TREE (local_classes, type);
if (!uses_template_parms (type)) if (!uses_template_parms (type))
{ {
if (flag_new_abi) if (flag_new_abi)
DECL_ASSEMBLER_NAME (d) = mangle_type (type); DECL_ASSEMBLER_NAME (d) = mangle_type (type);
...@@ -4049,7 +4049,7 @@ pushdecl (x) ...@@ -4049,7 +4049,7 @@ pushdecl (x)
warn if we later see static one. */ warn if we later see static one. */
if (IDENTIFIER_GLOBAL_VALUE (name) == NULL_TREE && TREE_PUBLIC (x)) if (IDENTIFIER_GLOBAL_VALUE (name) == NULL_TREE && TREE_PUBLIC (x))
TREE_PUBLIC (name) = 1; TREE_PUBLIC (name) = 1;
/* Bind the mangled name for the entity. In the future, we /* Bind the mangled name for the entity. In the future, we
should not need to do this; mangled names are an should not need to do this; mangled names are an
implementation detail of which the front-end should not implementation detail of which the front-end should not
...@@ -4745,7 +4745,7 @@ redeclaration_error_message (newdecl, olddecl) ...@@ -4745,7 +4745,7 @@ redeclaration_error_message (newdecl, olddecl)
else if (TREE_CODE (newdecl) == TEMPLATE_DECL) else if (TREE_CODE (newdecl) == TEMPLATE_DECL)
{ {
if ((TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == FUNCTION_DECL if ((TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == FUNCTION_DECL
&& (DECL_TEMPLATE_RESULT (newdecl) && (DECL_TEMPLATE_RESULT (newdecl)
!= DECL_TEMPLATE_RESULT (olddecl)) != DECL_TEMPLATE_RESULT (olddecl))
&& DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl)) && DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl))
&& DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl))) && DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)))
...@@ -5152,7 +5152,7 @@ struct cp_switch ...@@ -5152,7 +5152,7 @@ struct cp_switch
mark the stack for garbage collection because it is only active mark the stack for garbage collection because it is only active
during the processing of the body of a function, and we never during the processing of the body of a function, and we never
collect at that point. */ collect at that point. */
static struct cp_switch *switch_stack; static struct cp_switch *switch_stack;
/* Called right after a switch-statement condition is parsed. /* Called right after a switch-statement condition is parsed.
...@@ -5175,7 +5175,7 @@ void ...@@ -5175,7 +5175,7 @@ void
pop_switch () pop_switch ()
{ {
struct cp_switch *cs; struct cp_switch *cs;
cs = switch_stack; cs = switch_stack;
splay_tree_delete (cs->cases); splay_tree_delete (cs->cases);
switch_stack = switch_stack->next; switch_stack = switch_stack->next;
...@@ -5197,7 +5197,7 @@ finish_case_label (low_value, high_value) ...@@ -5197,7 +5197,7 @@ finish_case_label (low_value, high_value)
if (high_value) if (high_value)
error ("case label not within a switch statement"); error ("case label not within a switch statement");
else if (low_value) else if (low_value)
cp_error ("case label `%E' not within a switch statement", cp_error ("case label `%E' not within a switch statement",
low_value); low_value);
else else
error ("`default' label not within a switch statement"); error ("`default' label not within a switch statement");
...@@ -5698,8 +5698,8 @@ select_decl (binding, flags) ...@@ -5698,8 +5698,8 @@ select_decl (binding, flags)
/* When we implicitly declare some builtin entity, we mark it /* When we implicitly declare some builtin entity, we mark it
DECL_ANTICIPATED, so that we know to ignore it until it is DECL_ANTICIPATED, so that we know to ignore it until it is
really declared. */ really declared. */
if (val && DECL_P (val) if (val && DECL_P (val)
&& DECL_LANG_SPECIFIC (val) && DECL_LANG_SPECIFIC (val)
&& DECL_ANTICIPATED (val)) && DECL_ANTICIPATED (val))
return NULL_TREE; return NULL_TREE;
...@@ -6267,7 +6267,7 @@ typedef struct predefined_identifier ...@@ -6267,7 +6267,7 @@ typedef struct predefined_identifier
/* Create all the predefined identifiers. */ /* Create all the predefined identifiers. */
static void static void
initialize_predefined_identifiers () initialize_predefined_identifiers ()
{ {
struct predefined_identifier *pid; struct predefined_identifier *pid;
...@@ -6385,7 +6385,7 @@ init_decl_processing () ...@@ -6385,7 +6385,7 @@ init_decl_processing ()
void_type_node); void_type_node);
pushdecl (fake_std_node); pushdecl (fake_std_node);
} }
/* Define `int' and `char' first so that dbx will output them first. */ /* Define `int' and `char' first so that dbx will output them first. */
record_builtin_type (RID_INT, NULL_PTR, integer_type_node); record_builtin_type (RID_INT, NULL_PTR, integer_type_node);
record_builtin_type (RID_CHAR, "char", char_type_node); record_builtin_type (RID_CHAR, "char", char_type_node);
...@@ -6405,7 +6405,7 @@ init_decl_processing () ...@@ -6405,7 +6405,7 @@ init_decl_processing ()
long_long_unsigned_type_node); long_long_unsigned_type_node);
record_builtin_type (RID_SHORT, "short int", short_integer_type_node); record_builtin_type (RID_SHORT, "short int", short_integer_type_node);
record_builtin_type (RID_MAX, "short unsigned int", record_builtin_type (RID_MAX, "short unsigned int",
short_unsigned_type_node); short_unsigned_type_node);
record_builtin_type (RID_MAX, "unsigned short", record_builtin_type (RID_MAX, "unsigned short",
short_unsigned_type_node); short_unsigned_type_node);
...@@ -6576,12 +6576,7 @@ init_decl_processing () ...@@ -6576,12 +6576,7 @@ init_decl_processing ()
wchar_type_node = make_signed_type (wchar_type_size); wchar_type_node = make_signed_type (wchar_type_size);
else else
wchar_type_node = make_unsigned_type (wchar_type_size); wchar_type_node = make_unsigned_type (wchar_type_size);
record_builtin_type (RID_WCHAR, "__wchar_t", wchar_type_node); record_builtin_type (RID_WCHAR, "wchar_t", wchar_type_node);
/* Artificial declaration of wchar_t -- can be bashed */
wchar_decl_node = build_decl (TYPE_DECL, get_identifier ("wchar_t"),
wchar_type_node);
pushdecl (wchar_decl_node);
/* This is for wide string constants. */ /* This is for wide string constants. */
wchar_array_type_node wchar_array_type_node
...@@ -6760,7 +6755,7 @@ cp_make_fname_decl (id, name, type_dep) ...@@ -6760,7 +6755,7 @@ cp_make_fname_decl (id, name, type_dep)
tree decl, type, init; tree decl, type, init;
size_t length = strlen (name); size_t length = strlen (name);
tree domain = NULL_TREE; tree domain = NULL_TREE;
if (!processing_template_decl) if (!processing_template_decl)
type_dep = 0; type_dep = 0;
if (!type_dep) if (!type_dep)
...@@ -6791,7 +6786,7 @@ cp_make_fname_decl (id, name, type_dep) ...@@ -6791,7 +6786,7 @@ cp_make_fname_decl (id, name, type_dep)
} }
DECL_INITIAL (decl) = init; DECL_INITIAL (decl) = init;
cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING); cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING);
/* We will have to make sure we only emit this, if it is actually used. */ /* We will have to make sure we only emit this, if it is actually used. */
return decl; return decl;
} }
...@@ -6823,7 +6818,7 @@ builtin_function (name, type, code, class, libname) ...@@ -6823,7 +6818,7 @@ builtin_function (name, type, code, class, libname)
/* All builtins that don't begin with an `_' should go in the `std' /* All builtins that don't begin with an `_' should go in the `std'
namespace. */ namespace. */
if (flag_honor_std && name[0] != '_') if (flag_honor_std && name[0] != '_')
{ {
push_namespace (std_identifier); push_namespace (std_identifier);
DECL_CONTEXT (decl) = std_node; DECL_CONTEXT (decl) = std_node;
...@@ -6937,7 +6932,7 @@ push_cp_library_fn (operator_code, type) ...@@ -6937,7 +6932,7 @@ push_cp_library_fn (operator_code, type)
enum tree_code operator_code; enum tree_code operator_code;
tree type; tree type;
{ {
tree fn = build_cp_library_fn (ansi_opname (operator_code), tree fn = build_cp_library_fn (ansi_opname (operator_code),
operator_code, operator_code,
type); type);
pushdecl (fn); pushdecl (fn);
...@@ -7399,7 +7394,7 @@ start_decl_1 (decl) ...@@ -7399,7 +7394,7 @@ start_decl_1 (decl)
&& TREE_CODE (decl) != TYPE_DECL && TREE_CODE (decl) != TYPE_DECL
&& TREE_CODE (decl) != TEMPLATE_DECL && TREE_CODE (decl) != TEMPLATE_DECL
&& type != error_mark_node && type != error_mark_node
&& IS_AGGR_TYPE (type) && IS_AGGR_TYPE (type)
&& ! DECL_EXTERNAL (decl)) && ! DECL_EXTERNAL (decl))
{ {
if ((! processing_template_decl || ! uses_template_parms (type)) if ((! processing_template_decl || ! uses_template_parms (type))
...@@ -7922,7 +7917,7 @@ maybe_inject_for_scope_var (decl) ...@@ -7922,7 +7917,7 @@ maybe_inject_for_scope_var (decl)
{ {
if (!DECL_NAME (decl)) if (!DECL_NAME (decl))
return; return;
if (current_binding_level->is_for_scope) if (current_binding_level->is_for_scope)
{ {
struct binding_level *outer struct binding_level *outer
...@@ -8000,7 +7995,7 @@ initialize_local_var (decl, init, flags) ...@@ -8000,7 +7995,7 @@ initialize_local_var (decl, init, flags)
saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p (); saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p ();
current_stmt_tree ()->stmts_are_full_exprs_p = 1; current_stmt_tree ()->stmts_are_full_exprs_p = 1;
finish_expr_stmt (build_aggr_init (decl, init, flags)); finish_expr_stmt (build_aggr_init (decl, init, flags));
current_stmt_tree ()->stmts_are_full_exprs_p = current_stmt_tree ()->stmts_are_full_exprs_p =
saved_stmts_are_full_exprs_p; saved_stmts_are_full_exprs_p;
} }
...@@ -8114,9 +8109,9 @@ cp_finish_decl (decl, init, asmspec_tree, flags) ...@@ -8114,9 +8109,9 @@ cp_finish_decl (decl, init, asmspec_tree, flags)
if (type == error_mark_node) if (type == error_mark_node)
return; return;
/* Add this declaration to the statement-tree. */ /* Add this declaration to the statement-tree. */
if (building_stmt_tree () if (building_stmt_tree ()
&& at_function_scope_p () && at_function_scope_p ()
&& TREE_CODE (decl) != RESULT_DECL) && TREE_CODE (decl) != RESULT_DECL)
add_decl_stmt (decl); add_decl_stmt (decl);
...@@ -9140,12 +9135,12 @@ grokvardecl (type, declarator, specbits_in, initialized, constp, in_namespace) ...@@ -9140,12 +9135,12 @@ grokvardecl (type, declarator, specbits_in, initialized, constp, in_namespace)
set_decl_namespace (decl, context, 0); set_decl_namespace (decl, context, 0);
context = DECL_CONTEXT (decl); context = DECL_CONTEXT (decl);
if (declarator && context && current_lang_name != lang_name_c) if (declarator && context && current_lang_name != lang_name_c)
{ {
if (flag_new_abi) if (flag_new_abi)
DECL_ASSEMBLER_NAME (decl) = mangle_decl (decl); DECL_ASSEMBLER_NAME (decl) = mangle_decl (decl);
else else
DECL_ASSEMBLER_NAME (decl) DECL_ASSEMBLER_NAME (decl)
= build_static_name (context, declarator); = build_static_name (context, declarator);
} }
} }
...@@ -9550,7 +9545,7 @@ check_special_function_return_type (sfk, type, ctype, optype) ...@@ -9550,7 +9545,7 @@ check_special_function_return_type (sfk, type, ctype, optype)
case sfk_constructor: case sfk_constructor:
if (type) if (type)
cp_error ("return type specification for constructor invalid"); cp_error ("return type specification for constructor invalid");
/* In the old ABI, we return `this'; in the new ABI we don't /* In the old ABI, we return `this'; in the new ABI we don't
bother. */ bother. */
type = flag_new_abi ? void_type_node : build_pointer_type (ctype); type = flag_new_abi ? void_type_node : build_pointer_type (ctype);
...@@ -9871,7 +9866,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -9871,7 +9866,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
ctor_return_type = TREE_TYPE (dname); ctor_return_type = TREE_TYPE (dname);
sfk = sfk_conversion; sfk = sfk_conversion;
if (IDENTIFIER_GLOBAL_VALUE (dname) if (IDENTIFIER_GLOBAL_VALUE (dname)
&& (TREE_CODE (IDENTIFIER_GLOBAL_VALUE (dname)) && (TREE_CODE (IDENTIFIER_GLOBAL_VALUE (dname))
== TYPE_DECL)) == TYPE_DECL))
name = IDENTIFIER_POINTER (dname); name = IDENTIFIER_POINTER (dname);
else else
...@@ -10442,7 +10437,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10442,7 +10437,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
if (IDENTIFIER_TYPENAME_P (tmp)) if (IDENTIFIER_TYPENAME_P (tmp))
{ {
if (IDENTIFIER_GLOBAL_VALUE (tmp) if (IDENTIFIER_GLOBAL_VALUE (tmp)
&& (TREE_CODE (IDENTIFIER_GLOBAL_VALUE (tmp)) && (TREE_CODE (IDENTIFIER_GLOBAL_VALUE (tmp))
== TYPE_DECL)) == TYPE_DECL))
name = IDENTIFIER_POINTER (tmp); name = IDENTIFIER_POINTER (tmp);
else else
...@@ -10585,7 +10580,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10585,7 +10580,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
type = create_array_type_for_decl (dname, type, size); type = create_array_type_for_decl (dname, type, size);
/* VLAs never work as fields. */ /* VLAs never work as fields. */
if (decl_context == FIELD && !processing_template_decl if (decl_context == FIELD && !processing_template_decl
&& TREE_CODE (type) == ARRAY_TYPE && TREE_CODE (type) == ARRAY_TYPE
&& TYPE_DOMAIN (type) != NULL_TREE && TYPE_DOMAIN (type) != NULL_TREE
&& !TREE_CONSTANT (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))) && !TREE_CONSTANT (TYPE_MAX_VALUE (TYPE_DOMAIN (type))))
...@@ -10948,7 +10943,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -10948,7 +10943,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
t = ctype; t = ctype;
while (t != NULL_TREE && CLASS_TYPE_P (t)) while (t != NULL_TREE && CLASS_TYPE_P (t))
{ {
/* You're supposed to have one `template <...>' /* You're supposed to have one `template <...>'
for every template class, but you don't need one for every template class, but you don't need one
for a full specialization. For example: for a full specialization. For example:
...@@ -11191,7 +11186,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -11191,7 +11186,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
DECL_NAME (CLASSTYPE_TI_TEMPLATE (type)) DECL_NAME (CLASSTYPE_TI_TEMPLATE (type))
= TYPE_IDENTIFIER (type); = TYPE_IDENTIFIER (type);
if (flag_new_abi) if (flag_new_abi)
DECL_ASSEMBLER_NAME (decl) = mangle_type (type); DECL_ASSEMBLER_NAME (decl) = mangle_type (type);
else else
{ {
...@@ -11203,7 +11198,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -11203,7 +11198,7 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
DECL_CONTEXT (decl) = current_class_type; DECL_CONTEXT (decl) = current_class_type;
else else
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace); DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
DECL_ASSEMBLER_NAME (decl) = DECL_NAME (decl); DECL_ASSEMBLER_NAME (decl) = DECL_NAME (decl);
DECL_ASSEMBLER_NAME (decl) DECL_ASSEMBLER_NAME (decl)
= get_identifier (build_overload_name (type, 1, 1)); = get_identifier (build_overload_name (type, 1, 1));
...@@ -11984,7 +11979,7 @@ check_default_argument (decl, arg) ...@@ -11984,7 +11979,7 @@ check_default_argument (decl, arg)
The keyword `this' shall not be used in a default argument of a The keyword `this' shall not be used in a default argument of a
member function. */ member function. */
var = walk_tree_without_duplicates (&arg, local_variable_p_walkfn, var = walk_tree_without_duplicates (&arg, local_variable_p_walkfn,
NULL); NULL);
if (var) if (var)
{ {
...@@ -12409,7 +12404,7 @@ grok_op_properties (decl, virtualp, friendp) ...@@ -12409,7 +12404,7 @@ grok_op_properties (decl, virtualp, friendp)
case CALL_EXPR: case CALL_EXPR:
TYPE_OVERLOADS_CALL_EXPR (current_class_type) = 1; TYPE_OVERLOADS_CALL_EXPR (current_class_type) = 1;
break; break;
case ARRAY_REF: case ARRAY_REF:
TYPE_OVERLOADS_ARRAY_REF (current_class_type) = 1; TYPE_OVERLOADS_ARRAY_REF (current_class_type) = 1;
break; break;
...@@ -12418,19 +12413,19 @@ grok_op_properties (decl, virtualp, friendp) ...@@ -12418,19 +12413,19 @@ grok_op_properties (decl, virtualp, friendp)
case MEMBER_REF: case MEMBER_REF:
TYPE_OVERLOADS_ARROW (current_class_type) = 1; TYPE_OVERLOADS_ARROW (current_class_type) = 1;
break; break;
case NEW_EXPR: case NEW_EXPR:
TYPE_HAS_NEW_OPERATOR (current_class_type) = 1; TYPE_HAS_NEW_OPERATOR (current_class_type) = 1;
break; break;
case DELETE_EXPR: case DELETE_EXPR:
TYPE_GETS_DELETE (current_class_type) |= 1; TYPE_GETS_DELETE (current_class_type) |= 1;
break; break;
case VEC_NEW_EXPR: case VEC_NEW_EXPR:
TYPE_HAS_ARRAY_NEW_OPERATOR (current_class_type) = 1; TYPE_HAS_ARRAY_NEW_OPERATOR (current_class_type) = 1;
break; break;
case VEC_DELETE_EXPR: case VEC_DELETE_EXPR:
TYPE_GETS_DELETE (current_class_type) |= 2; TYPE_GETS_DELETE (current_class_type) |= 2;
break; break;
...@@ -12508,7 +12503,7 @@ grok_op_properties (decl, virtualp, friendp) ...@@ -12508,7 +12503,7 @@ grok_op_properties (decl, virtualp, friendp)
{ {
int ref = (TREE_CODE (t) == REFERENCE_TYPE); int ref = (TREE_CODE (t) == REFERENCE_TYPE);
const char *what = 0; const char *what = 0;
if (ref) if (ref)
t = TYPE_MAIN_VARIANT (TREE_TYPE (t)); t = TYPE_MAIN_VARIANT (TREE_TYPE (t));
...@@ -12528,7 +12523,7 @@ grok_op_properties (decl, virtualp, friendp) ...@@ -12528,7 +12523,7 @@ grok_op_properties (decl, virtualp, friendp)
} }
} }
if (DECL_ASSIGNMENT_OPERATOR_P (decl) if (DECL_ASSIGNMENT_OPERATOR_P (decl)
&& operator_code == NOP_EXPR) && operator_code == NOP_EXPR)
{ {
tree parmtype; tree parmtype;
...@@ -13128,9 +13123,9 @@ xref_basetypes (code_type_node, name, ref, binfo) ...@@ -13128,9 +13123,9 @@ xref_basetypes (code_type_node, name, ref, binfo)
if (CLASS_TYPE_P (basetype)) if (CLASS_TYPE_P (basetype))
{ {
TYPE_HAS_NEW_OPERATOR (ref) TYPE_HAS_NEW_OPERATOR (ref)
|= TYPE_HAS_NEW_OPERATOR (basetype); |= TYPE_HAS_NEW_OPERATOR (basetype);
TYPE_HAS_ARRAY_NEW_OPERATOR (ref) TYPE_HAS_ARRAY_NEW_OPERATOR (ref)
|= TYPE_HAS_ARRAY_NEW_OPERATOR (basetype); |= TYPE_HAS_ARRAY_NEW_OPERATOR (basetype);
TYPE_GETS_DELETE (ref) |= TYPE_GETS_DELETE (basetype); TYPE_GETS_DELETE (ref) |= TYPE_GETS_DELETE (basetype);
/* If the base-class uses multiple inheritance, so do we. */ /* If the base-class uses multiple inheritance, so do we. */
...@@ -13760,7 +13755,7 @@ start_function (declspecs, declarator, attrs, flags) ...@@ -13760,7 +13755,7 @@ start_function (declspecs, declarator, attrs, flags)
/* If we are (erroneously) defining a function that we have already /* If we are (erroneously) defining a function that we have already
defined before, wipe out what we knew before. */ defined before, wipe out what we knew before. */
if (!DECL_PENDING_INLINE_P (decl1) if (!DECL_PENDING_INLINE_P (decl1)
&& DECL_SAVED_FUNCTION_DATA (decl1)) && DECL_SAVED_FUNCTION_DATA (decl1))
{ {
free (DECL_SAVED_FUNCTION_DATA (decl1)); free (DECL_SAVED_FUNCTION_DATA (decl1));
...@@ -13960,7 +13955,7 @@ store_parm_decls (current_function_parms) ...@@ -13960,7 +13955,7 @@ store_parm_decls (current_function_parms)
else else
cp_error ("parameter `%D' declared void", parm); cp_error ("parameter `%D' declared void", parm);
cleanup = (processing_template_decl cleanup = (processing_template_decl
? NULL_TREE ? NULL_TREE
: maybe_build_cleanup (parm)); : maybe_build_cleanup (parm));
...@@ -14726,7 +14721,7 @@ lang_mark_tree (t) ...@@ -14726,7 +14721,7 @@ lang_mark_tree (t)
{ {
ggc_mark (ld); ggc_mark (ld);
c_mark_lang_decl (&ld->decl_flags.base); c_mark_lang_decl (&ld->decl_flags.base);
if (!DECL_GLOBAL_CTOR_P (t) if (!DECL_GLOBAL_CTOR_P (t)
&& !DECL_GLOBAL_DTOR_P (t) && !DECL_GLOBAL_DTOR_P (t)
&& !DECL_THUNK_P (t)) && !DECL_THUNK_P (t))
ggc_mark_tree (ld->decl_flags.u2.access); ggc_mark_tree (ld->decl_flags.u2.access);
......
...@@ -170,7 +170,7 @@ make_pointer_declarator (cv_qualifiers, target) ...@@ -170,7 +170,7 @@ make_pointer_declarator (cv_qualifiers, target)
We return an ADDR_EXPR whose "contents" are TARGET We return an ADDR_EXPR whose "contents" are TARGET
and whose type is the modifier list. */ and whose type is the modifier list. */
tree tree
make_reference_declarator (cv_qualifiers, target) make_reference_declarator (cv_qualifiers, target)
tree cv_qualifiers, target; tree cv_qualifiers, target;
...@@ -199,7 +199,7 @@ tree ...@@ -199,7 +199,7 @@ tree
make_call_declarator (target, parms, cv_qualifiers, exception_specification) make_call_declarator (target, parms, cv_qualifiers, exception_specification)
tree target, parms, cv_qualifiers, exception_specification; tree target, parms, cv_qualifiers, exception_specification;
{ {
target = build_parse_node (CALL_EXPR, target, target = build_parse_node (CALL_EXPR, target,
tree_cons (parms, cv_qualifiers, NULL_TREE), tree_cons (parms, cv_qualifiers, NULL_TREE),
/* The third operand is really RTL. We /* The third operand is really RTL. We
shouldn't put anything there. */ shouldn't put anything there. */
...@@ -323,7 +323,7 @@ init_cpp_parse () ...@@ -323,7 +323,7 @@ init_cpp_parse ()
operator_name_info_t operator_name_info[(int) LAST_CPLUS_TREE_CODE]; operator_name_info_t operator_name_info[(int) LAST_CPLUS_TREE_CODE];
/* Similar, but for assignment operators. */ /* Similar, but for assignment operators. */
operator_name_info_t assignment_operator_name_info[(int) LAST_CPLUS_TREE_CODE]; operator_name_info_t assignment_operator_name_info[(int) LAST_CPLUS_TREE_CODE];
/* Initialize data structures that keep track of operator names. */ /* Initialize data structures that keep track of operator names. */
#define DEF_OPERATOR(NAME, C, NM, OM, AR, AP) \ #define DEF_OPERATOR(NAME, C, NM, OM, AR, AP) \
...@@ -337,7 +337,7 @@ init_operators () ...@@ -337,7 +337,7 @@ init_operators ()
tree identifier; tree identifier;
char buffer[256]; char buffer[256];
struct operator_name_info_t *oni; struct operator_name_info_t *oni;
#define DEF_OPERATOR(NAME, CODE, NEW_MANGLING, OLD_MANGLING, ARITY, ASSN_P) \ #define DEF_OPERATOR(NAME, CODE, NEW_MANGLING, OLD_MANGLING, ARITY, ASSN_P) \
sprintf (buffer, ISALPHA (NAME[0]) ? "operator %s" : "operator%s", NAME); \ sprintf (buffer, ISALPHA (NAME[0]) ? "operator %s" : "operator%s", NAME); \
identifier = get_identifier (buffer); \ identifier = get_identifier (buffer); \
...@@ -353,7 +353,7 @@ init_operators () ...@@ -353,7 +353,7 @@ init_operators ()
#include "operators.def" #include "operators.def"
#undef DEF_OPERATOR #undef DEF_OPERATOR
operator_name_info[(int) ERROR_MARK].identifier operator_name_info[(int) ERROR_MARK].identifier
= get_identifier ("<invalid operator>"); = get_identifier ("<invalid operator>");
/* Handle some special cases. These operators are not defined in /* Handle some special cases. These operators are not defined in
...@@ -361,8 +361,8 @@ init_operators () ...@@ -361,8 +361,8 @@ init_operators ()
for error-reporting. (Eventually, we should ensure that this for error-reporting. (Eventually, we should ensure that this
does not happen. Error messages involving these operators will does not happen. Error messages involving these operators will
be confusing to users.) */ be confusing to users.) */
operator_name_info [(int) INIT_EXPR].name operator_name_info [(int) INIT_EXPR].name
= operator_name_info [(int) MODIFY_EXPR].name; = operator_name_info [(int) MODIFY_EXPR].name;
operator_name_info [(int) EXACT_DIV_EXPR].name = "(ceiling /)"; operator_name_info [(int) EXACT_DIV_EXPR].name = "(ceiling /)";
operator_name_info [(int) CEIL_DIV_EXPR].name = "(ceiling /)"; operator_name_info [(int) CEIL_DIV_EXPR].name = "(ceiling /)";
...@@ -380,19 +380,19 @@ init_operators () ...@@ -380,19 +380,19 @@ init_operators ()
operator_name_info [(int) RANGE_EXPR].name = "..."; operator_name_info [(int) RANGE_EXPR].name = "...";
operator_name_info [(int) CONVERT_EXPR].name = "+"; operator_name_info [(int) CONVERT_EXPR].name = "+";
assignment_operator_name_info [(int) EXACT_DIV_EXPR].name assignment_operator_name_info [(int) EXACT_DIV_EXPR].name
= "(exact /=)"; = "(exact /=)";
assignment_operator_name_info [(int) CEIL_DIV_EXPR].name assignment_operator_name_info [(int) CEIL_DIV_EXPR].name
= "(ceiling /=)"; = "(ceiling /=)";
assignment_operator_name_info [(int) FLOOR_DIV_EXPR].name assignment_operator_name_info [(int) FLOOR_DIV_EXPR].name
= "(floor /=)"; = "(floor /=)";
assignment_operator_name_info [(int) ROUND_DIV_EXPR].name assignment_operator_name_info [(int) ROUND_DIV_EXPR].name
= "(round /=)"; = "(round /=)";
assignment_operator_name_info [(int) CEIL_MOD_EXPR].name assignment_operator_name_info [(int) CEIL_MOD_EXPR].name
= "(ceiling %=)"; = "(ceiling %=)";
assignment_operator_name_info [(int) FLOOR_MOD_EXPR].name assignment_operator_name_info [(int) FLOOR_MOD_EXPR].name
= "(floor %=)"; = "(floor %=)";
assignment_operator_name_info [(int) ROUND_MOD_EXPR].name assignment_operator_name_info [(int) ROUND_MOD_EXPR].name
= "(round %=)"; = "(round %=)";
} }
...@@ -443,7 +443,6 @@ static const struct resword reswords[] = ...@@ -443,7 +443,6 @@ static const struct resword reswords[] =
{ "__typeof__", RID_TYPEOF, 0 }, { "__typeof__", RID_TYPEOF, 0 },
{ "__volatile", RID_VOLATILE, 0 }, { "__volatile", RID_VOLATILE, 0 },
{ "__volatile__", RID_VOLATILE, 0 }, { "__volatile__", RID_VOLATILE, 0 },
{ "__wchar_t", RID_WCHAR, 0 },
{ "asm", RID_ASM, D_ASM }, { "asm", RID_ASM, D_ASM },
{ "and", RID_AND, D_OPNAME }, { "and", RID_AND, D_OPNAME },
{ "and_eq", RID_AND_EQ, D_OPNAME }, { "and_eq", RID_AND_EQ, D_OPNAME },
...@@ -515,6 +514,7 @@ static const struct resword reswords[] = ...@@ -515,6 +514,7 @@ static const struct resword reswords[] =
{ "virtual", RID_VIRTUAL, 0 }, { "virtual", RID_VIRTUAL, 0 },
{ "void", RID_VOID, 0 }, { "void", RID_VOID, 0 },
{ "volatile", RID_VOLATILE, 0 }, { "volatile", RID_VOLATILE, 0 },
{ "wchar_t", RID_WCHAR, 0 },
{ "while", RID_WHILE, 0 }, { "while", RID_WHILE, 0 },
{ "xor", RID_XOR, D_OPNAME }, { "xor", RID_XOR, D_OPNAME },
{ "xor_eq", RID_XOR_EQ, D_OPNAME }, { "xor_eq", RID_XOR_EQ, D_OPNAME },
...@@ -560,7 +560,7 @@ const short rid_to_yy[RID_MAX] = ...@@ -560,7 +560,7 @@ const short rid_to_yy[RID_MAX] =
/* RID_BYCOPY */ 0, /* RID_BYCOPY */ 0,
/* RID_BYREF */ 0, /* RID_BYREF */ 0,
/* RID_ONEWAY */ 0, /* RID_ONEWAY */ 0,
/* C */ /* C */
/* RID_INT */ TYPESPEC, /* RID_INT */ TYPESPEC,
/* RID_CHAR */ TYPESPEC, /* RID_CHAR */ TYPESPEC,
...@@ -708,7 +708,7 @@ init_parse (filename) ...@@ -708,7 +708,7 @@ init_parse (filename)
set_identifier_size (sizeof (struct lang_identifier)); set_identifier_size (sizeof (struct lang_identifier));
decl_printable_name = lang_printable_name; decl_printable_name = lang_printable_name;
internal_filename = ggc_alloc_string (INTERNAL_FILENAME, internal_filename = ggc_alloc_string (INTERNAL_FILENAME,
sizeof (INTERNAL_FILENAME)); sizeof (INTERNAL_FILENAME));
input_filename = internal_filename; input_filename = internal_filename;
...@@ -896,7 +896,7 @@ print_parse_statistics () ...@@ -896,7 +896,7 @@ print_parse_statistics ()
int i; int i;
int maxlen = REDUCE_LENGTH; int maxlen = REDUCE_LENGTH;
unsigned *sorted; unsigned *sorted;
if (reduce_count[-1] == 0) if (reduce_count[-1] == 0)
return; return;
...@@ -981,7 +981,7 @@ extract_interface_info () ...@@ -981,7 +981,7 @@ extract_interface_info ()
if (flag_alt_external_templates) if (flag_alt_external_templates)
{ {
tree til = tinst_for_decl (); tree til = tinst_for_decl ();
if (til) if (til)
finfo = get_fileinfo (TINST_FILE (til)); finfo = get_fileinfo (TINST_FILE (til));
} }
...@@ -1117,7 +1117,7 @@ parse_strconst_pragma (name, opt) ...@@ -1117,7 +1117,7 @@ parse_strconst_pragma (name, opt)
error ("invalid #pragma %s", name); error ("invalid #pragma %s", name);
return (tree)-1; return (tree)-1;
} }
static void static void
handle_pragma_vtable (dfile) handle_pragma_vtable (dfile)
cpp_reader *dfile ATTRIBUTE_UNUSED; cpp_reader *dfile ATTRIBUTE_UNUSED;
...@@ -1392,15 +1392,15 @@ do_identifier (token, parsing, args) ...@@ -1392,15 +1392,15 @@ do_identifier (token, parsing, args)
like local variables, rather than creating TEMPLATE_DECLs for the like local variables, rather than creating TEMPLATE_DECLs for the
local variables and then finding matching instantiations. */ local variables and then finding matching instantiations. */
if (current_template_parms if (current_template_parms
&& (is_overloaded_fn (id) && (is_overloaded_fn (id)
|| (TREE_CODE (id) == VAR_DECL || (TREE_CODE (id) == VAR_DECL
&& CP_DECL_CONTEXT (id) && CP_DECL_CONTEXT (id)
&& TREE_CODE (CP_DECL_CONTEXT (id)) == FUNCTION_DECL) && TREE_CODE (CP_DECL_CONTEXT (id)) == FUNCTION_DECL)
|| TREE_CODE (id) == PARM_DECL || TREE_CODE (id) == PARM_DECL
|| TREE_CODE (id) == RESULT_DECL || TREE_CODE (id) == RESULT_DECL
|| TREE_CODE (id) == USING_DECL)) || TREE_CODE (id) == USING_DECL))
id = build_min_nt (LOOKUP_EXPR, token); id = build_min_nt (LOOKUP_EXPR, token);
return id; return id;
} }
...@@ -1418,7 +1418,7 @@ do_scoped_id (token, parsing) ...@@ -1418,7 +1418,7 @@ do_scoped_id (token, parsing)
id = NULL_TREE; id = NULL_TREE;
else else
id = BINDING_VALUE (id); id = BINDING_VALUE (id);
} }
else else
id = IDENTIFIER_GLOBAL_VALUE (token); id = IDENTIFIER_GLOBAL_VALUE (token);
if (parsing && yychar == YYEMPTY) if (parsing && yychar == YYEMPTY)
...@@ -1616,7 +1616,7 @@ cp_make_lang_type (code) ...@@ -1616,7 +1616,7 @@ cp_make_lang_type (code)
{ {
struct lang_type *pi; struct lang_type *pi;
pi = ((struct lang_type *) pi = ((struct lang_type *)
ggc_alloc_cleared (sizeof (struct lang_type))); ggc_alloc_cleared (sizeof (struct lang_type)));
TYPE_LANG_SPECIFIC (t) = pi; TYPE_LANG_SPECIFIC (t) = pi;
...@@ -1669,9 +1669,9 @@ compiler_error VPARAMS ((const char *msg, ...)) ...@@ -1669,9 +1669,9 @@ compiler_error VPARAMS ((const char *msg, ...))
#endif #endif
char buf[1024]; char buf[1024];
va_list ap; va_list ap;
VA_START (ap, msg); VA_START (ap, msg);
#ifndef ANSI_PROTOTYPES #ifndef ANSI_PROTOTYPES
msg = va_arg (ap, const char *); msg = va_arg (ap, const char *);
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment