diff options
author | Aldy Hernandez <aldyh@redhat.com> | 2006-05-05 19:57:38 +0000 |
---|---|---|
committer | Aldy Hernandez <aldyh@gcc.gnu.org> | 2006-05-05 19:57:38 +0000 |
commit | 8d8d1a280135e6530e1d2eb42c5ff8b91a8f570c (patch) | |
tree | 31aff53c7f9388180b8f468318913668e9cb42be /gcc/cp/rtti.c | |
parent | b207220873a208cab0b8fea85bf5be77bcd15914 (diff) | |
download | gcc-8d8d1a280135e6530e1d2eb42c5ff8b91a8f570c.zip gcc-8d8d1a280135e6530e1d2eb42c5ff8b91a8f570c.tar.gz gcc-8d8d1a280135e6530e1d2eb42c5ff8b91a8f570c.tar.bz2 |
c-parser.c (c_parser_cast_expression): Only insert casts into hash table if pointer.
PR/21391
* c-parser.c (c_parser_cast_expression): Only insert casts into
hash table if pointer.
* function.c (used_types_insert_helper): Rename from
used_types_insert.
(used_types_insert): Call used_types_insert_helper.
* function.h (used_types_insert): Accept only one argument.
* cp/typeck.c (build_static_cast_1): Save casted types in used types
hash table.
(build_reinterpret_cast_1): Same.
* cp/rtti.c (build_dynamic_cast_1): Same.
* testsuite/g++.dg/other/unused1.C: New.
From-SVN: r113561
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r-- | gcc/cp/rtti.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) |