This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
C++: fix for a spurious warning in__builtin_constant_p
- To: gcc-patches at gcc dot gnu dot org
- Subject: C++: fix for a spurious warning in__builtin_constant_p
- From: Andrew Haley <aph at redhat dot com>
- Date: Mon, 5 Mar 2001 18:22:18 +0000 (GMT)
I'm getting an error of
warning: cannot pass objects of non-POD type
`class Foo' through `...'
for __builtin_constant_p (). That isn't right IMO.
Does this patch make sense?
Andrew.
2001-03-05 Andrew Haley <aph@redhat.com>
* typeck.c (convert_arguments): Don't do ellipsis conversion for
__built_in_constant_p.
RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
retrieving revision 1.339
diff -p -2 -c -r1.339 typeck.c
*** typeck.c 2001/02/14 16:41:44 1.339
--- typeck.c 2001/03/05 18:18:45
*************** 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 (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);
}