aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/rtti.c3
-rw-r--r--gcc/cp/typeck.c9
3 files changed, 20 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index d4a01fc..f423f4f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,11 @@
+2006-05-03 Aldy Hernandez <aldyh@redhat.com>
+
+ PR/21391
+ * typeck.c (build_static_cast_1): Save casted types in used types
+ hash table.
+ (build_reinterpret_cast_1): Same.
+ * rtti.c (build_dynamic_cast_1): Same.
+
2006-05-04 Jakub Jelinek <jakub@redhat.com>
PR c++/27359
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 5c6d38d..6242e44 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -464,6 +464,9 @@ build_dynamic_cast_1 (tree type, tree expr)
tree old_expr = expr;
const char *errstr = NULL;
+ /* Save casted types in the function's used types hash table. */
+ used_types_insert (type);
+
/* T shall be a pointer or reference to a complete class type, or
`pointer to cv void''. */
switch (tc)
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 394a4ec..78e3a2b 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -4759,6 +4759,9 @@ build_static_cast_1 (tree type, tree expr, bool c_cast_p,
intype = TREE_TYPE (expr);
+ /* Save casted types in the function's used types hash table. */
+ used_types_insert (type);
+
/* Determine what to do when casting away constness. */
if (c_cast_p)
{
@@ -5047,6 +5050,9 @@ build_reinterpret_cast_1 (tree type, tree expr, bool c_cast_p,
intype = TREE_TYPE (expr);
+ /* Save casted types in the function's used types hash table. */
+ used_types_insert (type);
+
/* [expr.reinterpret.cast]
An lvalue expression of type T1 can be cast to the type
"reference to T2" if an expression of type "pointer to T1" can be
@@ -5242,6 +5248,9 @@ build_const_cast_1 (tree dst_type, tree expr, bool complain,
return error_mark_node;
}
+ /* Save casted types in the function's used types hash table. */
+ used_types_insert (dst_type);
+
src_type = TREE_TYPE (expr);
/* Expressions do not really have reference types. */
if (TREE_CODE (src_type) == REFERENCE_TYPE)