diff options
author | Jason Merrill <jason@casey.cygnus.com> | 2000-04-11 00:38:39 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2000-04-10 20:38:39 -0400 |
commit | 2bdb0643b3ae045242492171070c11957727150c (patch) | |
tree | c5516cfcd94a09cc0c73c7cf3b57d9e185fcbf03 /gcc/cp/rtti.c | |
parent | a4ff8d98baa9fcc92bdd294d4db3e9d9146cd590 (diff) | |
download | gcc-2bdb0643b3ae045242492171070c11957727150c.zip gcc-2bdb0643b3ae045242492171070c11957727150c.tar.gz gcc-2bdb0643b3ae045242492171070c11957727150c.tar.bz2 |
class.c (instantiate_type): Handle object-relative template-id.
* class.c (instantiate_type): Handle object-relative template-id.
* semantics.c (finish_expr_stmt): Call convert_to_void here.
* decl.c (cplus_expand_expr_stmt): Not here.
* rtti.c (build_dynamic_cast_1): Call non_lvalue.
Initialize exprtype earlier.
* parse.y (fn.def1): Check for defining types in return types.
* decl.c (check_tag_decl): Notice extra fundamental types.
Diagnose empty decls in classes, too.
* decl.c (grokdeclarator): Don't override an anonymous name if no
declarator was given.
* cvt.c (convert_to_void): Call resolve_offset_ref.
* typeck.c (build_x_function_call): Abort if we get an OFFSET_REF.
* decl2.c (decl_namespace): Handle getting a type.
* typeck.c (build_c_cast): Re-enable warning for cast between
pointer and integer of different size.
From-SVN: r33066
Diffstat (limited to 'gcc/cp/rtti.c')
-rw-r--r-- | gcc/cp/rtti.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c index 029d4d8..1154f41 100644 --- a/gcc/cp/rtti.c +++ b/gcc/cp/rtti.c @@ -558,7 +558,7 @@ build_dynamic_cast_1 (type, expr) tree type, expr; { enum tree_code tc = TREE_CODE (type); - tree exprtype; + tree exprtype = TREE_TYPE (expr); tree dcast_fn; tree old_expr = expr; const char *errstr = NULL; @@ -589,10 +589,10 @@ build_dynamic_cast_1 (type, expr) } if (TREE_CODE (expr) == OFFSET_REF) - expr = resolve_offset_ref (expr); - - exprtype = TREE_TYPE (expr); - assert (exprtype != NULL_TREE); + { + expr = resolve_offset_ref (expr); + exprtype = TREE_TYPE (expr); + } if (tc == POINTER_TYPE) expr = convert_from_reference (expr); @@ -676,7 +676,12 @@ build_dynamic_cast_1 (type, expr) } if (distance >= 0) - return build_vbase_path (PLUS_EXPR, type, expr, path, 0); + { + expr = build_vbase_path (PLUS_EXPR, type, expr, path, 0); + if (TREE_CODE (exprtype) == POINTER_TYPE) + expr = non_lvalue (expr); + return expr; + } } /* Otherwise *exprtype must be a polymorphic class (have a vtbl). */ |