Commit d67cdbc3 by Jason Merrill Committed by Jason Merrill

error.c (dump_decl): operator==, not operator ==.

        * error.c (dump_decl): operator==, not operator ==.
        (op_to_string): Likewise.

        * decl.c (compute_array_index_type): Handle null name.

        * decl2.c (ambiguous_decl): Fix to match comment.
        (lookup_using_namespace): Adjust.

        * decl2.c (import_export_class): Don't ignore dllimport.

From-SVN: r30935
parent 08b962b0
1999-12-14 Jason Merrill <jason@casey.cygnus.com>
* error.c (dump_decl): operator==, not operator ==.
(op_to_string): Likewise.
* decl.c (compute_array_index_type): Handle null name.
* decl2.c (ambiguous_decl): Fix to match comment.
(lookup_using_namespace): Adjust.
* decl2.c (import_export_class): Don't ignore dllimport.
1999-12-14 Mark Mitchell <mark@codesourcery.com> 1999-12-14 Mark Mitchell <mark@codesourcery.com>
* class.c (check_field_decls): Split out from ... * class.c (check_field_decls): Split out from ...
......
...@@ -8743,7 +8743,10 @@ compute_array_index_type (name, size) ...@@ -8743,7 +8743,10 @@ compute_array_index_type (name, size)
&& TREE_CODE (TREE_TYPE (size)) != ENUMERAL_TYPE && TREE_CODE (TREE_TYPE (size)) != ENUMERAL_TYPE
&& TREE_CODE (TREE_TYPE (size)) != BOOLEAN_TYPE) && TREE_CODE (TREE_TYPE (size)) != BOOLEAN_TYPE)
{ {
cp_error ("size of array `%D' has non-integer type", name); if (name)
cp_error ("size of array `%D' has non-integer type", name);
else
cp_error ("size of array has non-integer type");
size = integer_one_node; size = integer_one_node;
} }
...@@ -8762,14 +8765,22 @@ compute_array_index_type (name, size) ...@@ -8762,14 +8765,22 @@ compute_array_index_type (name, size)
/* An array must have a positive number of elements. */ /* An array must have a positive number of elements. */
if (INT_CST_LT (size, integer_zero_node)) if (INT_CST_LT (size, integer_zero_node))
{ {
cp_error ("size of array `%D' is negative", name); if (name)
cp_error ("size of array `%D' is negative", name);
else
cp_error ("size of array is negative");
size = integer_one_node; size = integer_one_node;
} }
/* Except that an extension we allow zero-sized arrays. We /* Except that an extension we allow zero-sized arrays. We
always allow them in system headers because glibc uses always allow them in system headers because glibc uses
them. */ them. */
else if (integer_zerop (size) && pedantic && !in_system_header) else if (integer_zerop (size) && pedantic && !in_system_header)
cp_pedwarn ("ANSI C++ forbids zero-size array `%D'", name); {
if (name)
cp_pedwarn ("ANSI C++ forbids zero-size array `%D'", name);
else
cp_pedwarn ("ANSI C++ forbids zero-size array");
}
} }
/* Compute the index of the largest element in the array. It is /* Compute the index of the largest element in the array. It is
......
...@@ -2458,9 +2458,10 @@ import_export_class (ctype) ...@@ -2458,9 +2458,10 @@ import_export_class (ctype)
#ifdef VALID_MACHINE_TYPE_ATTRIBUTE #ifdef VALID_MACHINE_TYPE_ATTRIBUTE
/* FIXME this should really use some sort of target-independent macro. */ /* FIXME this should really use some sort of target-independent macro. */
if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (ctype))) if (lookup_attribute ("dllimport", TYPE_ATTRIBUTES (ctype)))
import_export = -1; /* Use -2 so we survive the MULTIPLE_SYMBOL_SPACES check below. */
import_export = -2;
else if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (ctype))) else if (lookup_attribute ("dllexport", TYPE_ATTRIBUTES (ctype)))
import_export = 1; import_export = 2;
#endif #endif
/* If we got -fno-implicit-templates, we import template classes that /* If we got -fno-implicit-templates, we import template classes that
...@@ -4264,7 +4265,7 @@ ambiguous_decl (name, old, new, flags) ...@@ -4264,7 +4265,7 @@ ambiguous_decl (name, old, new, flags)
} }
cp_error_at (" also declared as `%#D' here", val); cp_error_at (" also declared as `%#D' here", val);
} }
return error_mark_node; BINDING_VALUE (old) = error_mark_node;
} }
} }
/* ... and copy the type. */ /* ... and copy the type. */
...@@ -4312,7 +4313,7 @@ lookup_using_namespace (name, val, usings, scope, flags, spacesp) ...@@ -4312,7 +4313,7 @@ lookup_using_namespace (name, val, usings, scope, flags, spacesp)
/* Resolve ambiguities. */ /* Resolve ambiguities. */
val = ambiguous_decl (name, val, val1, flags); val = ambiguous_decl (name, val, val1, flags);
} }
return val != error_mark_node; return BINDING_VALUE (val) != error_mark_node;
} }
/* [namespace.qual] /* [namespace.qual]
......
...@@ -945,7 +945,7 @@ dump_decl (t, flags) ...@@ -945,7 +945,7 @@ dump_decl (t, flags)
else if (IDENTIFIER_OPNAME_P (t)) else if (IDENTIFIER_OPNAME_P (t))
{ {
const char *name_string = operator_name_string (t); const char *name_string = operator_name_string (t);
OB_PUTS ("operator "); OB_PUTS ("operator");
OB_PUTCP (name_string); OB_PUTCP (name_string);
} }
else else
...@@ -1276,7 +1276,7 @@ dump_function_name (t, flags) ...@@ -1276,7 +1276,7 @@ dump_function_name (t, flags)
else if (IDENTIFIER_OPNAME_P (name)) else if (IDENTIFIER_OPNAME_P (name))
{ {
const char *name_string = operator_name_string (name); const char *name_string = operator_name_string (name);
OB_PUTS ("operator "); OB_PUTS ("operator");
OB_PUTCP (name_string); OB_PUTCP (name_string);
} }
else else
...@@ -2205,7 +2205,7 @@ decl_to_string (decl, verbose) ...@@ -2205,7 +2205,7 @@ decl_to_string (decl, verbose)
int verbose; int verbose;
{ {
enum tree_string_flags flags = 0; enum tree_string_flags flags = 0;
if (TREE_CODE (decl) == TYPE_DECL || TREE_CODE (decl) == RECORD_TYPE if (TREE_CODE (decl) == TYPE_DECL || TREE_CODE (decl) == RECORD_TYPE
|| TREE_CODE (decl) == UNION_TYPE || TREE_CODE (decl) == ENUMERAL_TYPE) || TREE_CODE (decl) == UNION_TYPE || TREE_CODE (decl) == ENUMERAL_TYPE)
flags = TS_AGGR_TAGS; flags = TS_AGGR_TAGS;
...@@ -2312,7 +2312,7 @@ op_to_string (p, v) ...@@ -2312,7 +2312,7 @@ op_to_string (p, v)
if (p == 0) if (p == 0)
return "{unknown}"; return "{unknown}";
strcpy (buf + 9, opname_tab [p]); strcpy (buf + 8, opname_tab [p]);
return buf; return buf;
} }
......
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