* c-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine.
* c-tree.h (c_incomplete_type_error): New.
* c-typeck.c (require_complete_type, build_component_ref): Update.
(incomplete_type_error): Rename.
* langhooks-def.h (lhd_incomplete_type_error): New.
(LANG_HOOKS_INCOMPLETE_TYPE_ERROR): New.
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Update.
* langhooks.c (lhd_incomplete_type_error): New.
* langhooks.h (struct lang_hooks_for_types): New hook.
* tree.c (size_in_bytes): Use new hook.
* tree.h (incomplete_type_error): Remove.
ada: * gigi.h (incomplete_type_error): Remove.
* utils.c (incomplete_type_error): Remove.
cp:
* call.c (build_new_method_call): Update.
* cp-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine.
* cp-tree.h (cxx_incomplete_type_error): New.
* decl.c (grokdeclarator, grokparms): Update.
* decl2.c (check_classfn): Update.
* pt.c (tsubst): Update.
* typeck.c (complete_type_or_else, expr_sizeof,
decay_conversion): Update.
* typeck2.c (incomplete_type_error): Rename.
(add_exception_specifier): Update.
f:
* com.c (incomplete_type_error): Remove.
java:
* typeck.c (incomplete_type_error): Remove.
objc:
* objc-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine.
From-SVN: r52480
+2002-04-18 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * c-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine.
+ * c-tree.h (c_incomplete_type_error): New.
+ * c-typeck.c (require_complete_type, build_component_ref): Update.
+ (incomplete_type_error): Rename.
+ * langhooks-def.h (lhd_incomplete_type_error): New.
+ (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): New.
+ (LANG_HOOKS_FOR_TYPES_INITIALIZER): Update.
+ * langhooks.c (lhd_incomplete_type_error): New.
+ * langhooks.h (struct lang_hooks_for_types): New hook.
+ * tree.c (size_in_bytes): Use new hook.
+ * tree.h (incomplete_type_error): Remove.
+objc:
+ * objc-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine.
+
2002-04-18 Zack Weinberg <zack@codesourcery.com>
* config/arc/arc.md: Remove #if HOST_FLOAT_FORMAT !=
+2002-04-18 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * gigi.h (incomplete_type_error): Remove.
+ * utils.c (incomplete_type_error): Remove.
+
2002-04-16 Mark Mitchell <mark@codesourcery.com>
* trans.c (tree_transform): Add has_scope argument to
UNSIGNEDP. */
extern tree gnat_signed_or_unsigned_type PARAMS ((int, tree));
-/* This routine is called in tree.c to print an error message for invalid use
- of an incomplete type. */
-extern void incomplete_type_error PARAMS ((tree, tree));
-
/* This function is called indirectly from toplev.c to handle incomplete
declarations, i.e. VAR_DECL nodes whose DECL_SIZE is zero. To be precise,
compile_file in toplev.c makes an indirect call through the function pointer
ggc_add_tree_root (gnat_raise_decls, ARRAY_SIZE (gnat_raise_decls));
}
\f
-/* This routine is called in tree.c to print an error message for invalid use
- of an incomplete type. */
-
-void
-incomplete_type_error (dont_care_1, dont_care_2)
- tree dont_care_1 ATTRIBUTE_UNUSED;
- tree dont_care_2 ATTRIBUTE_UNUSED;
-{
- gigi_abort (404);
-}
-
/* This function is called indirectly from toplev.c to handle incomplete
declarations, i.e. VAR_DECL nodes whose DECL_SIZE is zero. To be precise,
compile_file in toplev.c makes an indirect call through the function pointer
#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type
#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type
+#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR
+#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR c_incomplete_type_error
/* ### When changing hooks, consider if ObjC needs changing too!! ### */
extern tree c_sizeof_nowarn PARAMS ((tree));
extern tree c_size_in_bytes PARAMS ((tree));
extern bool c_mark_addressable PARAMS ((tree));
+extern void c_incomplete_type_error PARAMS ((tree, tree));
extern tree build_component_ref PARAMS ((tree, tree));
extern tree build_indirect_ref PARAMS ((tree, const char *));
extern tree build_array_ref PARAMS ((tree, tree));
if (COMPLETE_TYPE_P (type))
return value;
- incomplete_type_error (value, type);
+ c_incomplete_type_error (value, type);
return error_mark_node;
}
and TYPE is the type that was invalid. */
void
-incomplete_type_error (value, type)
+c_incomplete_type_error (value, type)
tree value;
tree type;
{
{
if (!COMPLETE_TYPE_P (type))
{
- incomplete_type_error (NULL_TREE, type);
+ c_incomplete_type_error (NULL_TREE, type);
return error_mark_node;
}
+2002-04-18 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * call.c (build_new_method_call): Update.
+ * cp-lang.c (LANG_HOOKS_INCOMPLETE_TYPE_ERROR): Redefine.
+ * cp-tree.h (cxx_incomplete_type_error): New.
+ * decl.c (grokdeclarator, grokparms): Update.
+ * decl2.c (check_classfn): Update.
+ * pt.c (tsubst): Update.
+ * typeck.c (complete_type_or_else, expr_sizeof,
+ decay_conversion): Update.
+ * typeck2.c (incomplete_type_error): Rename.
+ (add_exception_specifier): Update.
+
2002-04-18 Jason Merrill <jason@redhat.com>
PR c++/5658
if (flags & LOOKUP_SPECULATIVELY)
return NULL_TREE;
if (!COMPLETE_TYPE_P (basetype))
- incomplete_type_error (instance_ptr, basetype);
+ cxx_incomplete_type_error (instance_ptr, basetype);
else
error ("no matching function for call to `%T::%D(%A)%#V'",
basetype, pretty_name, user_args,
#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type
#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type
+#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR
+#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR cxx_incomplete_type_error
/* Each front end provides its own hooks, for toplev.c. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
build_binary_op(code, arg1, arg2, 1)
/* in typeck2.c */
+extern void cxx_incomplete_type_error PARAMS ((tree, tree));
extern tree error_not_base_type PARAMS ((tree, tree));
extern tree binfo_or_else PARAMS ((tree, tree));
extern void readonly_error PARAMS ((tree, const char *, int));
}
else
{
- incomplete_type_error (NULL_TREE, ctype);
+ cxx_incomplete_type_error (NULL_TREE, ctype);
return error_mark_node;
}
&& !DECL_NAME (decl) && !result && !chain && !ellipsis)
/* this is a parmlist of `(void)', which is ok. */
break;
- incomplete_type_error (decl, type);
+ cxx_incomplete_type_error (decl, type);
/* It's not a good idea to actually create parameters of
type `void'; other parts of the compiler assume that a
void type terminates the parameter list. */
{
methods = 0;
if (!COMPLETE_TYPE_P (ctype))
- incomplete_type_error (function, ctype);
+ cxx_incomplete_type_error (function, ctype);
else
error ("no `%#D' member function declared in class `%T'",
function, ctype);
if (!COMPLETE_TYPE_P (ctx))
{
if (complain & tf_error)
- incomplete_type_error (NULL_TREE, ctx);
+ cxx_incomplete_type_error (NULL_TREE, ctx);
return error_mark_node;
}
}
return NULL_TREE;
else if (!COMPLETE_TYPE_P (type))
{
- incomplete_type_error (value, type);
+ cxx_incomplete_type_error (value, type);
return NULL_TREE;
}
else
}
else if (type_unknown_p (e))
{
- incomplete_type_error (e, TREE_TYPE (e));
+ cxx_incomplete_type_error (e, TREE_TYPE (e));
return c_sizeof (char_type_node);
}
/* It's illegal to say `sizeof (X::i)' for `i' a non-static data
if (type_unknown_p (exp))
{
- incomplete_type_error (exp, TREE_TYPE (exp));
+ cxx_incomplete_type_error (exp, TREE_TYPE (exp));
return error_mark_node;
}
and TYPE is the type that was invalid. */
void
-incomplete_type_error (value, type)
+cxx_incomplete_type_error (value, type)
tree value;
tree type;
{
}
}
else if (complain)
- incomplete_type_error (NULL_TREE, core);
+ cxx_incomplete_type_error (NULL_TREE, core);
return list;
}
+Thu Apr 18 19:10:44 2002 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * com.c (incomplete_type_error): Remove.
+
Tue Apr 16 14:55:47 2002 Mark Mitchell <mark@codesourcery.com>
* com.c (ffecom_expr_power_integer): Add has_scope argument to
return current_binding_level == global_binding_level;
}
-/* Print an error message for invalid use of an incomplete type.
- VALUE is the expression that was used (or 0 if that isn't known)
- and TYPE is the type that was invalid. */
-
-void
-incomplete_type_error (value, type)
- tree value UNUSED;
- tree type;
-{
- if (TREE_CODE (type) == ERROR_MARK)
- return;
-
- assert ("incomplete type?!?" == NULL);
-}
-
/* Mark ARG for GC. */
static void
mark_binding_level (void *arg)
+2002-04-18 Neil Booth <neil@daikokuya.demon.co.uk>
+
+ * typeck.c (incomplete_type_error): Remove.
+
2002-04-18 Bryce McKinlay <bryce@waitaki.otago.ac.nz>
* class.c (make_class_data): Set DECL_ALIGN on static class data,
return build1 (NOP_EXPR, type, expr);
}
-/* Print an error message for invalid use of an incomplete type.
- VALUE is the expression that was used (or 0 if that isn't known)
- and TYPE is the type that was invalid. */
-
-void
-incomplete_type_error (value, type)
- tree value ATTRIBUTE_UNUSED;
- tree type ATTRIBUTE_UNUSED;
-{
- error ("internal error - use of undefined type");
-}
-
/* Return a data type that has machine mode MODE.
If the mode is an integer,
then UNSIGNEDP selects between signed and unsigned types. */
const char *));
extern void lhd_set_decl_assembler_name PARAMS ((tree));
extern bool lhd_warn_unused_global_decl PARAMS ((tree));
+extern void lhd_incomplete_type_error PARAMS ((tree, tree));
/* Declarations of default tree inlining hooks. */
tree lhd_tree_inlining_walk_subtrees PARAMS ((tree *, int *,
/* Types hooks. There are no reasonable defaults for most of them,
so we create a compile-time error instead. */
#define LANG_HOOKS_MAKE_TYPE make_node
+#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR lhd_incomplete_type_error
#define LANG_HOOKS_FOR_TYPES_INITIALIZER { \
LANG_HOOKS_MAKE_TYPE, \
LANG_HOOKS_TYPE_FOR_SIZE, \
LANG_HOOKS_UNSIGNED_TYPE, \
LANG_HOOKS_SIGNED_TYPE, \
- LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE \
+ LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE, \
+ LANG_HOOKS_INCOMPLETE_TYPE_ERROR \
}
/* Declaration hooks. */
poplevel (0, 0, 0);
}
+/* Invalid use of an incomplete type. */
+void
+lhd_incomplete_type_error (value, type)
+ tree value ATTRIBUTE_UNUSED, type;
+{
+ if (TREE_CODE (type) == ERROR_MARK)
+ return;
+
+ abort ();
+}
+
/* Provide a default routine for alias sets that always returns -1. This
is used by languages that don't need to do anything special. */
/* Return a type the same as TYPE except unsigned or signed
according to UNSIGNEDP. */
tree (*signed_or_unsigned_type) PARAMS ((int, tree));
+
+ /* This routine is called in tree.c to print an error message for
+ invalid use of an incomplete type. VALUE is the expression that
+ was used (or 0 if that isn't known) and TYPE is the type that was
+ invalid. */
+ void (*incomplete_type_error) PARAMS ((tree value, tree type));
};
/* Language hooks related to decls and the symbol table. */
#define LANG_HOOKS_UNSIGNED_TYPE c_common_unsigned_type
#undef LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE
#define LANG_HOOKS_SIGNED_OR_UNSIGNED_TYPE c_common_signed_or_unsigned_type
+#undef LANG_HOOKS_INCOMPLETE_TYPE_ERROR
+#define LANG_HOOKS_INCOMPLETE_TYPE_ERROR c_incomplete_type_error
/* Each front end provides its own hooks, for toplev.c. */
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
if (t == 0)
{
- incomplete_type_error (NULL_TREE, type);
+ (*lang_hooks.types.incomplete_type_error) (NULL_TREE, type);
return size_zero_node;
}
/* Flag saying whether common language attributes are to be supported. */
extern int lang_attribute_common;
-/* In front end. */
-
-extern void incomplete_type_error PARAMS ((tree, tree));
-
/* In integrate.c */
extern void save_for_inline PARAMS ((tree));
extern void set_decl_abstract_flags PARAMS ((tree, int));