+2006-08-11 Benjamin Smedberg <benjamin@smedbergs.us>
+
+ PR c++/28687
+ * rtti.c (build_dynamic_cast, build_dynamic_cast_1):
+ Move -fno-rtti check to be more specific.
+
2006-08-22 Jason Merrill <jason@redhat.com>
PR c++/23372
}
}
+ /* Use of dynamic_cast when -fno-rtti is prohibited. */
+ if (!flag_rtti)
+ {
+ error ("%<dynamic_cast%> not permitted with -fno-rtti");
+ return error_mark_node;
+ }
+
target_type = TYPE_MAIN_VARIANT (TREE_TYPE (type));
static_type = TYPE_MAIN_VARIANT (TREE_TYPE (exprtype));
td2 = get_tinfo_decl (target_type);
if (type == error_mark_node || expr == error_mark_node)
return error_mark_node;
- /* Use of dynamic_cast when -fno-rtti is prohibited. */
- if (!flag_rtti)
- {
- error ("%<dynamic_cast%> not permitted with -fno-rtti");
- return error_mark_node;
- }
-
if (processing_template_decl)
{
expr = build_min (DYNAMIC_CAST_EXPR, type, expr);
(@samp{dynamic_cast} and @samp{typeid}). If you don't use those parts
of the language, you can save some space by using this flag. Note that
exception handling uses the same information, but it will generate it as
-needed.
+needed. The @samp{dynamic_cast} operator can still be used for casts that
+do not require runtime type information, i.e. casts to @code{void *} or to
+unambiguous base classes.
@item -fstats
@opindex fstats