+1999-04-27 Nathan Sidwell <nathan@acm.org>
+
+ * rtti.c (build_x_typeid): Check rtti is enabled.
+
1999-04-26 Mark Mitchell <mark@codesourcery.com>
* search.c (is_subobject_of_p): Make sure we're looking at the
tree exp;
{
tree cond = NULL_TREE;
- tree type = TREE_TYPE (tinfo_fn_type);
+ tree type;
int nonnull;
+ if (! flag_rtti)
+ {
+ error ("cannot use typeid with -fno-rtti");
+ return error_mark_node;
+ }
+
if (TYPE_SIZE (type_info_type_node) == NULL_TREE)
{
error ("must #include <typeinfo> before using typeid");
if (exp == error_mark_node)
return error_mark_node;
+ type = TREE_TYPE (tinfo_fn_type);
exp = build_call (exp, type, NULL_TREE);
if (cond)
--- /dev/null
+// Build don't link:
+// Special g++ Options: -fno-rtti
+
+// Copyright (C) 1999 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 9 Apr 1999 <nathan@acm.org>
+// derrived from bug report from Alexander Zvyagin <zvyagin@mx.ihep.su>
+
+// check we don't die with disabled rtti
+
+
+int main(void) {
+ int i;
+ typeid(i); // ERROR - rtti disabled
+}