This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++: fix for a spurious warning in__builtin_constant_p
Jason Merrill writes:
> >>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:
>
> > Does this patch make sense?
>
> It's ugly, but I don't see how to do it better. OK for trunk.
I just checked in a slightly different version of the patch because
fndecl might be null.
Andrew.
Index: typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
retrieving revision 1.340
diff -c -p -2 -r1.340 typeck.c
*** typeck.c 2001/03/02 11:48:35 1.340
--- typeck.c 2001/03/06 20:42:44
*************** convert_arguments (typelist, values, fnd
*** 3208,3214 ****
val = convert_from_reference (val);
! result = tree_cons (NULL_TREE,
! convert_arg_to_ellipsis (val),
! result);
}
--- 3208,3221 ----
val = convert_from_reference (val);
! if (fndecl && DECL_BUILT_IN (fndecl)
! && DECL_FUNCTION_CODE (fndecl) == BUILT_IN_CONSTANT_P)
! /* Don't do ellipsis conversion for __built_in_constant_p
! as this will result in spurious warnings for non-POD
! types. */
! val = require_complete_type (val);
! else
! val = convert_arg_to_ellipsis (val);
!
! result = tree_cons (NULL_TREE, val, result);
}