aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2019-12-21 00:16:58 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2019-12-21 00:16:58 +0100
commit0bd002bf2e9f0224905ad19f036dde27b63c26c5 (patch)
tree83387415649c6516b7b2cb6a3f1c3bc44a19a384 /gcc/cp
parent6c7b84305a5e686644ee64bfd2d415f3f43fa85b (diff)
downloadgcc-0bd002bf2e9f0224905ad19f036dde27b63c26c5.zip
gcc-0bd002bf2e9f0224905ad19f036dde27b63c26c5.tar.gz
gcc-0bd002bf2e9f0224905ad19f036dde27b63c26c5.tar.bz2
re PR c++/92666 (bogus -Wunused-but-set-variable in gcov.c with -Wno-restrict)
PR c++/92666 * call.c (convert_arg_to_ellipsis): For floating point or decltype(nullptr) arguments call mark_rvalue_use. * g++.dg/warn/Wunused-var-36.C: New test. From-SVN: r279681
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/call.c2
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c6858f9..5a9a648 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
2019-12-20 Jakub Jelinek <jakub@redhat.com>
+ PR c++/92666
+ * call.c (convert_arg_to_ellipsis): For floating point or
+ decltype(nullptr) arguments call mark_rvalue_use.
+
PR c++/92992
* call.c (convert_arg_to_ellipsis): For decltype(nullptr) arguments
that have side-effects use cp_build_compound_expr.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index aeddf30..1abe1a7 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -7819,10 +7819,12 @@ convert_arg_to_ellipsis (tree arg, tsubst_flags_t complain)
"implicit conversion from %qH to %qI when passing "
"argument to function",
arg_type, double_type_node);
+ arg = mark_rvalue_use (arg);
arg = convert_to_real_nofold (double_type_node, arg);
}
else if (NULLPTR_TYPE_P (arg_type))
{
+ arg = mark_rvalue_use (arg);
if (TREE_SIDE_EFFECTS (arg))
arg = cp_build_compound_expr (arg, null_pointer_node, complain);
else