re PR c++/13683 (bogus warning about passing non-PODs through ellipsis)
PR c++/13683 * call.c (convert_arg_to_ellipsis): Don't emit a warning if within a sizeof expression.block From-SVN: r76963
This commit is contained in:
parent
3e2cc1d1c7
commit
5840af0f85
@ -1,3 +1,9 @@
|
|||||||
|
2004-01-30 Giovanni Bajo <giovannibajo@gcc.gnu.org>
|
||||||
|
|
||||||
|
PR c++/13683
|
||||||
|
* call.c (convert_arg_to_ellipsis): Don't emit a warning if within
|
||||||
|
a sizeof expression.block
|
||||||
|
|
||||||
2004-01-29 Mark Mitchell <mark@codesourcery.com>
|
2004-01-29 Mark Mitchell <mark@codesourcery.com>
|
||||||
|
|
||||||
PR c++/13883
|
PR c++/13883
|
||||||
|
@ -4127,14 +4127,18 @@ convert_arg_to_ellipsis (tree arg)
|
|||||||
|
|
||||||
arg = require_complete_type (arg);
|
arg = require_complete_type (arg);
|
||||||
|
|
||||||
if (arg != error_mark_node && ! pod_type_p (TREE_TYPE (arg)))
|
if (arg != error_mark_node
|
||||||
|
&& !pod_type_p (TREE_TYPE (arg)))
|
||||||
{
|
{
|
||||||
/* Undefined behavior [expr.call] 5.2.2/7. We used to just warn
|
/* Undefined behavior [expr.call] 5.2.2/7. We used to just warn
|
||||||
here and do a bitwise copy, but now cp_expr_size will abort if we
|
here and do a bitwise copy, but now cp_expr_size will abort if we
|
||||||
try to do that. */
|
try to do that.
|
||||||
warning ("cannot pass objects of non-POD type `%#T' through `...'; \
|
If the call appears in the context of a sizeof expression,
|
||||||
call will abort at runtime",
|
there is no need to emit a warning, since the expression won't be
|
||||||
TREE_TYPE (arg));
|
evaluated. We keep the builtin_trap just as a safety check. */
|
||||||
|
if (!skip_evaluation)
|
||||||
|
warning ("cannot pass objects of non-POD type `%#T' through `...'; "
|
||||||
|
"call will abort at runtime", TREE_TYPE (arg));
|
||||||
arg = call_builtin_trap (TREE_TYPE (arg));
|
arg = call_builtin_trap (TREE_TYPE (arg));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user