public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Michael Meissner <meissner@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc(refs/users/meissner/heads/ieee)] c++: Remove redundant calls to type_dependent_expression_p
Date: Thu, 16 Apr 2020 22:41:01 +0000 (GMT)	[thread overview]
Message-ID: <20200416224101.87C4C385DC03@sourceware.org> (raw)

https://gcc.gnu.org/g:54f58e9416debf139bd88d8055cdfbacf7e20204

commit 54f58e9416debf139bd88d8055cdfbacf7e20204
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue Mar 24 23:58:23 2020 -0400

    c++: Remove redundant calls to type_dependent_expression_p
    
    This simplifies conditions that test both value_dependent_expression_p and
    type_dependent_expression_p, since the former predicate now subsumes the latter.
    
    gcc/cp/ChangeLog:
    
            * decl.c (compute_array_index_type_loc): Remove redundant
            type_dependent_expression_p check that is subsumed by
            value_dependent_expression_p.
            * decl2.c (is_late_template_attribute): Likewise.
            * pt.c (uses_template_parms): Likewise.
            (dependent_template_arg_p): Likewise.

Diff:
---
 gcc/cp/ChangeLog | 9 +++++++++
 gcc/cp/decl.c    | 3 +--
 gcc/cp/decl2.c   | 3 +--
 gcc/cp/pt.c      | 6 ++----
 4 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 7d1161fd1c1..da556a4914e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,12 @@
+2020-03-27  Patrick Palka  <ppalka@redhat.com>
+
+	* decl.c (compute_array_index_type_loc): Remove redundant
+	type_dependent_expression_p check that is subsumed by
+	value_dependent_expression_p.
+	* decl2.c (is_late_template_attribute): Likewise.
+	* pt.c (uses_template_parms): Likewise.
+	(dependent_template_arg_p): Likewise.
+
 2020-03-26  Marek Polacek  <polacek@redhat.com>
 
 	DR 1710
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 319b7ee5c1c..69a238997b4 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10338,8 +10338,7 @@ compute_array_index_type_loc (location_t name_loc, tree name, tree size,
   /* We can only call value_dependent_expression_p on integral constant
      expressions; treat non-constant expressions as dependent, too.  */
   if (processing_template_decl
-      && (type_dependent_expression_p (size)
-	  || !TREE_CONSTANT (size) || value_dependent_expression_p (size)))
+      && (!TREE_CONSTANT (size) || value_dependent_expression_p (size)))
     {
       /* We cannot do any checking for a SIZE that isn't known to be
 	 constant. Just build the index type and mark that it requires
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 2efb2e54f37..6cf72b432e2 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1191,8 +1191,7 @@ is_late_template_attribute (tree attr, tree decl)
 	  && identifier_p (t))
 	continue;
 
-      if (value_dependent_expression_p (t)
-	  || type_dependent_expression_p (t))
+      if (value_dependent_expression_p (t))
 	return true;
     }
 
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 3c96eeca191..7ea8ce4cbc3 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -10525,8 +10525,7 @@ uses_template_parms (tree t)
   else if (t == error_mark_node)
     dependent_p = false;
   else
-    dependent_p = (type_dependent_expression_p (t)
-		   || value_dependent_expression_p (t));
+    dependent_p = value_dependent_expression_p (t);
 
   processing_template_decl = saved_processing_template_decl;
 
@@ -27016,8 +27015,7 @@ dependent_template_arg_p (tree arg)
   else if (TYPE_P (arg))
     return dependent_type_p (arg);
   else
-    return (type_dependent_expression_p (arg)
-	    || value_dependent_expression_p (arg));
+    return value_dependent_expression_p (arg);
 }
 
 /* Returns true if ARGS (a collection of template arguments) contains


                 reply	other threads:[~2020-04-16 22:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200416224101.87C4C385DC03@sourceware.org \
    --to=meissner@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).