summaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/pt.c8
2 files changed, 12 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index a3bec1c02c4..0798f0fc503 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2020-05-06 Marek Polacek <polacek@redhat.com>
+
+ PR c++/94938
+ * pt.c (tsubst_copy_and_build): Call type_dependent_expression_p_push
+ instead of uses_template_parms. Move the warning_sentinels after the
+ RECURs.
+
2020-05-06 Jakub Jelinek <jakub@redhat.com>
PR c++/94951
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 2ed6d0e7457..c6091127225 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -19424,14 +19424,16 @@ tsubst_copy_and_build (tree t,
{
/* If T was type-dependent, suppress warnings that depend on the range
of the types involved. */
- bool was_dep = uses_template_parms (t);
+ bool was_dep = type_dependent_expression_p_push (t);
+
+ tree op0 = RECUR (TREE_OPERAND (t, 0));
+ tree op1 = RECUR (TREE_OPERAND (t, 1));
+
warning_sentinel s1(warn_type_limits, was_dep);
warning_sentinel s2(warn_div_by_zero, was_dep);
warning_sentinel s3(warn_logical_op, was_dep);
warning_sentinel s4(warn_tautological_compare, was_dep);
- tree op0 = RECUR (TREE_OPERAND (t, 0));
- tree op1 = RECUR (TREE_OPERAND (t, 1));
tree r = build_x_binary_op
(input_location, TREE_CODE (t),
op0,