+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>
* lex.c (do_identifier): Don't lookup_name for operators.
* error.c (dump_function_decl): Print no space between
`ptr-operator' the `type-specifier' of the return type.
(dump_type_prefix): Make sure we put space at the appropriate
- place.
+ place.
2000-10-23 Jason Merrill <jason@redhat.com>
* 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.
(dubious_conversion_warnings): Remove special-case code.
* tree.c (walk_tree): Handle VECTOR_TYPE.
* decl.c (init_decl_processing): Call MD_INIT_BUILTINS.
-
+
2000-10-21 Jason Merrill <jason@redhat.com>
* parse.y (operator): Set got_object from got_scope.
(splay_tree_compare_integer_csts): New function.
(layout_class_type): Use a splay_tree, rather than a varray, to
represent the offsets of empty bases.
-
+
* cp-tree.h (DECL_ANTICIPATED): Don't require a FUNCTION_DECL.
* decl.c (select_decl): Don't return declarations that are
DECL_ANTICIPATED.
* except.c (init_exception_processing): Use std_identifier.
* init.c (build_member_call): Use fake_std_node.
* rtti.c (init_rtti_processing): Use std_identifier.
-
+
2000-10-17 Mark Mitchell <mark@codesourcery.com>
* cp-tree.h (back_end_hook): Remove declaration.
(init_repo): Initialize it.
* search.c (current_obstack): Remove.
* typeck2.c (add_exception_specifier): Don't call build_decl_list.
-
+
2000-10-09 Richard Henderson <rth@cygnus.com>
* Make-lang.in (CXX_EXTRA_HEADERS): Remove.
* pt.c (lookup_template_class): Set current access for enum.
(tsubst_enum): Set file & line for enum decl.
-
+
* spew.c (yylex): Remove unused variable.
2000-10-05 Richard Henderson <rth@cygnus.com>
2000-10-05 Nathan Sidwell <nathan@codesourcery.com>
* pt.c (tsubst_expr, DECL_STMT case): Don't process if
- tsubsting fails.
+ tsubsting fails.
2000-10-05 Nathan Sidwell <nathan@codesourcery.com>
* decl.c (lang_mark_false_label_stack): Remove.
* lex.c (cp_mang_lang_type): Use ggc_alloc_cleared.
-
+
2000-09-30 Joseph S. Myers <jsm28@cam.ac.uk>
* gxxint.texi: Use @email for formatting email addresses.
static void end_cleanup_fn PARAMS ((void));
static tree cp_make_fname_decl PARAMS ((tree, const char *, int));
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));
static tree push_cp_library_fn PARAMS ((enum tree_code, tree));
static tree build_cp_library_fn PARAMS ((tree, enum tree_code, tree));
replaced with a TEMPLATE_DECL. */
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_PARMS_P will be set as well. */
unsigned template_spec_p : 1;
all function definitions in a translation unit in a convenient
way. (It's otherwise tricky to find a member function definition
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
&& !processing_template_decl)
VARRAY_PUSH_TREE (local_classes, type);
- if (!uses_template_parms (type))
+ if (!uses_template_parms (type))
{
if (flag_new_abi)
DECL_ASSEMBLER_NAME (d) = mangle_type (type);
warn if we later see static one. */
if (IDENTIFIER_GLOBAL_VALUE (name) == NULL_TREE && TREE_PUBLIC (x))
TREE_PUBLIC (name) = 1;
-
+
/* Bind the mangled name for the entity. In the future, we
should not need to do this; mangled names are an
implementation detail of which the front-end should not
else if (TREE_CODE (newdecl) == TEMPLATE_DECL)
{
if ((TREE_CODE (DECL_TEMPLATE_RESULT (newdecl)) == FUNCTION_DECL
- && (DECL_TEMPLATE_RESULT (newdecl)
+ && (DECL_TEMPLATE_RESULT (newdecl)
!= DECL_TEMPLATE_RESULT (olddecl))
&& DECL_INITIAL (DECL_TEMPLATE_RESULT (newdecl))
&& DECL_INITIAL (DECL_TEMPLATE_RESULT (olddecl)))
mark the stack for garbage collection because it is only active
during the processing of the body of a function, and we never
collect at that point. */
-
+
static struct cp_switch *switch_stack;
/* Called right after a switch-statement condition is parsed.
pop_switch ()
{
struct cp_switch *cs;
-
+
cs = switch_stack;
splay_tree_delete (cs->cases);
switch_stack = switch_stack->next;
if (high_value)
error ("case label not within a switch statement");
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);
else
error ("`default' label not within a switch statement");
/* When we implicitly declare some builtin entity, we mark it
DECL_ANTICIPATED, so that we know to ignore it until it is
really declared. */
- if (val && DECL_P (val)
- && DECL_LANG_SPECIFIC (val)
+ if (val && DECL_P (val)
+ && DECL_LANG_SPECIFIC (val)
&& DECL_ANTICIPATED (val))
return NULL_TREE;
/* Create all the predefined identifiers. */
static void
-initialize_predefined_identifiers ()
+initialize_predefined_identifiers ()
{
struct predefined_identifier *pid;
void_type_node);
pushdecl (fake_std_node);
}
-
+
/* 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_CHAR, "char", char_type_node);
long_long_unsigned_type_node);
record_builtin_type (RID_SHORT, "short int", short_integer_type_node);
record_builtin_type (RID_MAX, "short unsigned int",
- short_unsigned_type_node);
+ short_unsigned_type_node);
record_builtin_type (RID_MAX, "unsigned short",
short_unsigned_type_node);
wchar_type_node = make_signed_type (wchar_type_size);
else
wchar_type_node = make_unsigned_type (wchar_type_size);
- 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);
+ record_builtin_type (RID_WCHAR, "wchar_t", wchar_type_node);
/* This is for wide string constants. */
wchar_array_type_node
tree decl, type, init;
size_t length = strlen (name);
tree domain = NULL_TREE;
-
+
if (!processing_template_decl)
type_dep = 0;
if (!type_dep)
}
DECL_INITIAL (decl) = init;
cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING);
-
+
/* We will have to make sure we only emit this, if it is actually used. */
return decl;
}
/* All builtins that don't begin with an `_' should go in the `std'
namespace. */
- if (flag_honor_std && name[0] != '_')
+ if (flag_honor_std && name[0] != '_')
{
push_namespace (std_identifier);
DECL_CONTEXT (decl) = std_node;
enum tree_code operator_code;
tree type;
{
- tree fn = build_cp_library_fn (ansi_opname (operator_code),
+ tree fn = build_cp_library_fn (ansi_opname (operator_code),
operator_code,
type);
pushdecl (fn);
&& TREE_CODE (decl) != TYPE_DECL
&& TREE_CODE (decl) != TEMPLATE_DECL
&& type != error_mark_node
- && IS_AGGR_TYPE (type)
+ && IS_AGGR_TYPE (type)
&& ! DECL_EXTERNAL (decl))
{
if ((! processing_template_decl || ! uses_template_parms (type))
{
if (!DECL_NAME (decl))
return;
-
+
if (current_binding_level->is_for_scope)
{
struct binding_level *outer
saved_stmts_are_full_exprs_p = stmts_are_full_exprs_p ();
current_stmt_tree ()->stmts_are_full_exprs_p = 1;
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;
}
if (type == error_mark_node)
return;
-
+
/* Add this declaration to the statement-tree. */
- if (building_stmt_tree ()
+ if (building_stmt_tree ()
&& at_function_scope_p ()
&& TREE_CODE (decl) != RESULT_DECL)
add_decl_stmt (decl);
set_decl_namespace (decl, context, 0);
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)
DECL_ASSEMBLER_NAME (decl) = mangle_decl (decl);
else
- DECL_ASSEMBLER_NAME (decl)
+ DECL_ASSEMBLER_NAME (decl)
= build_static_name (context, declarator);
}
}
case sfk_constructor:
if (type)
cp_error ("return type specification for constructor invalid");
-
+
/* In the old ABI, we return `this'; in the new ABI we don't
bother. */
type = flag_new_abi ? void_type_node : build_pointer_type (ctype);
ctor_return_type = TREE_TYPE (dname);
sfk = sfk_conversion;
if (IDENTIFIER_GLOBAL_VALUE (dname)
- && (TREE_CODE (IDENTIFIER_GLOBAL_VALUE (dname))
+ && (TREE_CODE (IDENTIFIER_GLOBAL_VALUE (dname))
== TYPE_DECL))
name = IDENTIFIER_POINTER (dname);
else
if (IDENTIFIER_TYPENAME_P (tmp))
{
if (IDENTIFIER_GLOBAL_VALUE (tmp)
- && (TREE_CODE (IDENTIFIER_GLOBAL_VALUE (tmp))
+ && (TREE_CODE (IDENTIFIER_GLOBAL_VALUE (tmp))
== TYPE_DECL))
name = IDENTIFIER_POINTER (tmp);
else
type = create_array_type_for_decl (dname, type, size);
/* VLAs never work as fields. */
- if (decl_context == FIELD && !processing_template_decl
+ if (decl_context == FIELD && !processing_template_decl
&& TREE_CODE (type) == ARRAY_TYPE
&& TYPE_DOMAIN (type) != NULL_TREE
&& !TREE_CONSTANT (TYPE_MAX_VALUE (TYPE_DOMAIN (type))))
t = ctype;
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 a full specialization. For example:
DECL_NAME (CLASSTYPE_TI_TEMPLATE (type))
= TYPE_IDENTIFIER (type);
- if (flag_new_abi)
+ if (flag_new_abi)
DECL_ASSEMBLER_NAME (decl) = mangle_type (type);
else
{
DECL_CONTEXT (decl) = current_class_type;
else
DECL_CONTEXT (decl) = FROB_CONTEXT (current_namespace);
-
+
DECL_ASSEMBLER_NAME (decl) = DECL_NAME (decl);
DECL_ASSEMBLER_NAME (decl)
= get_identifier (build_overload_name (type, 1, 1));
The keyword `this' shall not be used in a default argument of a
member function. */
- var = walk_tree_without_duplicates (&arg, local_variable_p_walkfn,
+ var = walk_tree_without_duplicates (&arg, local_variable_p_walkfn,
NULL);
if (var)
{
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 MEMBER_REF:
TYPE_OVERLOADS_ARROW (current_class_type) = 1;
break;
-
+
case NEW_EXPR:
TYPE_HAS_NEW_OPERATOR (current_class_type) = 1;
break;
-
+
case DELETE_EXPR:
TYPE_GETS_DELETE (current_class_type) |= 1;
break;
-
+
case VEC_NEW_EXPR:
TYPE_HAS_ARRAY_NEW_OPERATOR (current_class_type) = 1;
break;
-
+
case VEC_DELETE_EXPR:
TYPE_GETS_DELETE (current_class_type) |= 2;
break;
{
int ref = (TREE_CODE (t) == REFERENCE_TYPE);
const char *what = 0;
-
+
if (ref)
t = TYPE_MAIN_VARIANT (TREE_TYPE (t));
}
}
- if (DECL_ASSIGNMENT_OPERATOR_P (decl)
+ if (DECL_ASSIGNMENT_OPERATOR_P (decl)
&& operator_code == NOP_EXPR)
{
tree parmtype;
if (CLASS_TYPE_P (basetype))
{
- TYPE_HAS_NEW_OPERATOR (ref)
+ TYPE_HAS_NEW_OPERATOR (ref)
|= TYPE_HAS_NEW_OPERATOR (basetype);
- TYPE_HAS_ARRAY_NEW_OPERATOR (ref)
+ TYPE_HAS_ARRAY_NEW_OPERATOR (ref)
|= TYPE_HAS_ARRAY_NEW_OPERATOR (basetype);
TYPE_GETS_DELETE (ref) |= TYPE_GETS_DELETE (basetype);
/* If the base-class uses multiple inheritance, so do we. */
/* If we are (erroneously) defining a function that we have already
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))
{
free (DECL_SAVED_FUNCTION_DATA (decl1));
else
cp_error ("parameter `%D' declared void", parm);
- cleanup = (processing_template_decl
+ cleanup = (processing_template_decl
? NULL_TREE
: maybe_build_cleanup (parm));
{
ggc_mark (ld);
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_THUNK_P (t))
ggc_mark_tree (ld->decl_flags.u2.access);
We return an ADDR_EXPR whose "contents" are TARGET
and whose type is the modifier list. */
-
+
tree
make_reference_declarator (cv_qualifiers, target)
tree cv_qualifiers, target;
make_call_declarator (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),
/* The third operand is really RTL. We
shouldn't put anything there. */
operator_name_info_t operator_name_info[(int) LAST_CPLUS_TREE_CODE];
/* Similar, but for assignment operators. */
operator_name_info_t assignment_operator_name_info[(int) LAST_CPLUS_TREE_CODE];
-
+
/* Initialize data structures that keep track of operator names. */
#define DEF_OPERATOR(NAME, C, NM, OM, AR, AP) \
tree identifier;
char buffer[256];
struct operator_name_info_t *oni;
-
+
#define DEF_OPERATOR(NAME, CODE, NEW_MANGLING, OLD_MANGLING, ARITY, ASSN_P) \
sprintf (buffer, ISALPHA (NAME[0]) ? "operator %s" : "operator%s", NAME); \
identifier = get_identifier (buffer); \
#include "operators.def"
#undef DEF_OPERATOR
- operator_name_info[(int) ERROR_MARK].identifier
+ operator_name_info[(int) ERROR_MARK].identifier
= get_identifier ("<invalid operator>");
/* Handle some special cases. These operators are not defined in
for error-reporting. (Eventually, we should ensure that this
does not happen. Error messages involving these operators will
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) EXACT_DIV_EXPR].name = "(ceiling /)";
operator_name_info [(int) CEIL_DIV_EXPR].name = "(ceiling /)";
operator_name_info [(int) RANGE_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 /=)";
- assignment_operator_name_info [(int) CEIL_DIV_EXPR].name
+ assignment_operator_name_info [(int) CEIL_DIV_EXPR].name
= "(ceiling /=)";
- assignment_operator_name_info [(int) FLOOR_DIV_EXPR].name
+ assignment_operator_name_info [(int) FLOOR_DIV_EXPR].name
= "(floor /=)";
- assignment_operator_name_info [(int) ROUND_DIV_EXPR].name
+ assignment_operator_name_info [(int) ROUND_DIV_EXPR].name
= "(round /=)";
- assignment_operator_name_info [(int) CEIL_MOD_EXPR].name
+ assignment_operator_name_info [(int) CEIL_MOD_EXPR].name
= "(ceiling %=)";
- assignment_operator_name_info [(int) FLOOR_MOD_EXPR].name
+ assignment_operator_name_info [(int) FLOOR_MOD_EXPR].name
= "(floor %=)";
- assignment_operator_name_info [(int) ROUND_MOD_EXPR].name
+ assignment_operator_name_info [(int) ROUND_MOD_EXPR].name
= "(round %=)";
}
{ "__typeof__", RID_TYPEOF, 0 },
{ "__volatile", RID_VOLATILE, 0 },
{ "__volatile__", RID_VOLATILE, 0 },
- { "__wchar_t", RID_WCHAR, 0 },
{ "asm", RID_ASM, D_ASM },
{ "and", RID_AND, D_OPNAME },
{ "and_eq", RID_AND_EQ, D_OPNAME },
{ "virtual", RID_VIRTUAL, 0 },
{ "void", RID_VOID, 0 },
{ "volatile", RID_VOLATILE, 0 },
+ { "wchar_t", RID_WCHAR, 0 },
{ "while", RID_WHILE, 0 },
{ "xor", RID_XOR, D_OPNAME },
{ "xor_eq", RID_XOR_EQ, D_OPNAME },
/* RID_BYCOPY */ 0,
/* RID_BYREF */ 0,
/* RID_ONEWAY */ 0,
-
+
/* C */
/* RID_INT */ TYPESPEC,
/* RID_CHAR */ TYPESPEC,
set_identifier_size (sizeof (struct lang_identifier));
decl_printable_name = lang_printable_name;
- internal_filename = ggc_alloc_string (INTERNAL_FILENAME,
+ internal_filename = ggc_alloc_string (INTERNAL_FILENAME,
sizeof (INTERNAL_FILENAME));
input_filename = internal_filename;
int i;
int maxlen = REDUCE_LENGTH;
unsigned *sorted;
-
+
if (reduce_count[-1] == 0)
return;
if (flag_alt_external_templates)
{
tree til = tinst_for_decl ();
-
+
if (til)
finfo = get_fileinfo (TINST_FILE (til));
}
error ("invalid #pragma %s", name);
return (tree)-1;
}
-
+
static void
handle_pragma_vtable (dfile)
cpp_reader *dfile ATTRIBUTE_UNUSED;
like local variables, rather than creating TEMPLATE_DECLs for the
local variables and then finding matching instantiations. */
if (current_template_parms
- && (is_overloaded_fn (id)
- || (TREE_CODE (id) == VAR_DECL
+ && (is_overloaded_fn (id)
+ || (TREE_CODE (id) == VAR_DECL
&& CP_DECL_CONTEXT (id)
&& TREE_CODE (CP_DECL_CONTEXT (id)) == FUNCTION_DECL)
|| TREE_CODE (id) == PARM_DECL
|| TREE_CODE (id) == RESULT_DECL
|| TREE_CODE (id) == USING_DECL))
id = build_min_nt (LOOKUP_EXPR, token);
-
+
return id;
}
id = NULL_TREE;
else
id = BINDING_VALUE (id);
- }
+ }
else
id = IDENTIFIER_GLOBAL_VALUE (token);
if (parsing && yychar == YYEMPTY)
{
struct lang_type *pi;
- pi = ((struct lang_type *)
+ pi = ((struct lang_type *)
ggc_alloc_cleared (sizeof (struct lang_type)));
TYPE_LANG_SPECIFIC (t) = pi;
#endif
char buf[1024];
va_list ap;
-
+
VA_START (ap, msg);
-
+
#ifndef ANSI_PROTOTYPES
msg = va_arg (ap, const char *);
#endif