From 2bdb0643b3ae045242492171070c11957727150c Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Tue, 11 Apr 2000 00:38:39 +0000 Subject: 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 --- gcc/cp/rtti.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'gcc/cp/rtti.c') 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). */ -- cgit v1.1