diff options
author | Nathan Sidwell <nathan@acm.org> | 1999-02-26 23:37:04 +0000 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 1999-02-26 18:37:04 -0500 |
commit | 665431699036e1b9bd2317d452579a6fc6af9482 (patch) | |
tree | 95146880bbae3e437264ebcc433d39108ea8419e /gcc/cp/cvt.c | |
parent | 99f25d8ea84021f7c7887a65085342760abd0c5a (diff) | |
download | gcc-665431699036e1b9bd2317d452579a6fc6af9482.zip gcc-665431699036e1b9bd2317d452579a6fc6af9482.tar.gz gcc-665431699036e1b9bd2317d452579a6fc6af9482.tar.bz2 |
typeck.c (complete_type_or_else): Add VALUE arg, for helpful diagnostics.
* typeck.c (complete_type_or_else): Add VALUE arg, for helpful
diagnostics.
cp-tree.h (complete_type_or_else): Added VALUE parameter.
* init.c (build_new_1): Extra arg to complete_type_or_else.
(build_delete): Likewise.
* typeck.c (require_complete_type): Likewise.
(pointer_int_sum): Likewise.
(pointer_diff): Likewise.
(build_component_ref): Likewise.
* typeck2.c (incomplete_type_error): Always use cp_error.
Show declaration of undefined type, if appropriate.
Deal with UNKNOWN_TYPE nodes.
* typeck.c (require_complete_type): Use TYPE_SIZE as
size_zero_node to mean incomplete type.
(require_complete_type_in_void): New function.
(build_compound_expr): Call complete_type_in_void for LHS.
(build_c_cast): Call complete_type_in_void for void cast.
* cvt.c (ocp_convert): Call complete_type_in_void for void cast.
* decl.c (cplus_expand_expr_stmt): Void expression checks moved to
require_complete_type_in_void. Call it.
* cp-tree.h (require_complete_type_in_void): Prototype new function.
* typeck.c (convert_arguments): Use alternative format for function
decls. Don't require_complete_type here. Simplify diagnostic printing.
(convert_for_initialization): Don't require_complete_type on RHS yet.
* call.c (convert_arg_to_ellipsis): Call require_complete_type.
* call.c (build_over_call): Cope with qualified void return type.
* semantics.c (finish_call_expr): Likewise
* typeck.c (build_function_call_real): Likewise
(c_expand_return): Likewise
* decl2.c (reparse_absdcl_as_expr): Cope with qualified void type.
* call.c (print_z_candidates): Use alternate print format, to be
consistant with (pt.c) print_candidates.
method.c (hack_identifier): List candidate members.
search.c (lookup_field): Build ambiguous list, and show it, if
ambiguous.
From-SVN: r25474
Diffstat (limited to 'gcc/cp/cvt.c')
-rw-r--r-- | gcc/cp/cvt.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c index b73020f..9f29c65 100644 --- a/gcc/cp/cvt.c +++ b/gcc/cp/cvt.c @@ -687,10 +687,11 @@ ocp_convert (type, expr, convtype, flags) if (code == VOID_TYPE && (convtype & CONV_STATIC)) { - if (type_unknown_p (e)) - error ("address of overloaded function with no contextual type information"); + e = require_complete_type_in_void (e); + if (e != error_mark_node) + e = build1 (CONVERT_EXPR, void_type_node, e); - return build1 (CONVERT_EXPR, type, e); + return e; } #if 0 |