aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorGiovanni Bajo <giovannibajo@gcc.gnu.org>2004-01-30 15:08:37 +0000
committerGiovanni Bajo <giovannibajo@gcc.gnu.org>2004-01-30 15:08:37 +0000
commit5840af0f8593a9d510df2d07b8b50b34a468769a (patch)
treed825222b3ea0d2d86d9edd0dde8e6832f7bc8db3 /gcc
parent3e2cc1d1c78e5060da86145eecd12e05f58bf1b0 (diff)
downloadgcc-5840af0f8593a9d510df2d07b8b50b34a468769a.zip
gcc-5840af0f8593a9d510df2d07b8b50b34a468769a.tar.gz
gcc-5840af0f8593a9d510df2d07b8b50b34a468769a.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/call.c14
2 files changed, 15 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 19e787e..0ffb1bf 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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>
PR c++/13883
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index ea494c7..d391b29 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -4127,14 +4127,18 @@ convert_arg_to_ellipsis (tree 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
here and do a bitwise copy, but now cp_expr_size will abort if we
- try to do that. */
- warning ("cannot pass objects of non-POD type `%#T' through `...'; \
-call will abort at runtime",
- TREE_TYPE (arg));
+ try to do that.
+ If the call appears in the context of a sizeof expression,
+ there is no need to emit a warning, since the expression won't be
+ 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));
}