This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Mismatched types in ADDR_EXPR from c-typeck.c:build_function_call
- From: Richard Guenther <rguenth at tat dot physik dot uni-tuebingen dot de>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: "Joseph S. Myers" <joseph at codesourcery dot com>, <gcc at gcc dot gnu dot org>
- Date: Wed, 18 May 2005 16:15:29 +0200 (CEST)
- Subject: Re: Mismatched types in ADDR_EXPR from c-typeck.c:build_function_call
On 18 May 2005, Gabriel Dos Reis wrote:
> "Joseph S. Myers" <joseph@codesourcery.com> writes:
>
> | On Wed, 18 May 2005, Richard Guenther wrote:
> |
> | > The following snippet
> | >
> | > /* Differs from default_conversion by not setting TREE_ADDRESSABLE
> | > (because calling an inline function does not mean the function
> | > needs to be separately compiled). */
> | > fntype = build_type_variant (TREE_TYPE (function),
> | > TREE_READONLY (function),
> | > TREE_THIS_VOLATILE (function));
> | > fundecl = function;
> | > function = build1 (ADDR_EXPR, build_pointer_type (fntype),
> | > function);
> |
> | If you want to avoid this then you need to arrange for const and noreturn
> | attributes on functions always to be represented by qualifiers on the type
> | and not on the decl. This is part of bug 3481.
> |
> | (a) Change handle_noreturn_attribute and handle_const_attribute to put the
> | qualifiers on the type in addition to the decl. This might be all you
>
> if you're doing that and that code at some point would be used by the
> C++ front-end, then you need to be very very careful because that is a
> very sensitive area for C++ -- especially for the type of address of
> functions, template argument deduction and the like.
Yup, I just noticed that trying to fix the bogous INDIRECT_REF
created in cp/cvt.c:convert_from_reference :/
Richard.
--
Richard Guenther <richard dot guenther at uni-tuebingen dot de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/