public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Centurion <centurionn009@gmail.com>
To: gcc-help@gcc.gnu.org
Subject: 
Date: Thu, 21 Mar 2024 19:12:23 +0400	[thread overview]
Message-ID: <CAKDwa5Ub7C+Cv1u_m_=NYsR6_1SgZV+O2_mxgGmvUBs4aM-HRA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 623 bytes --]

HI, I am new in gcc codebase. Can you explain please why we can't just use
TREE_TYPE(parm) for TEMLATE_TEMPLATE_PARM and why DECL_INITIAL is needed
for it? I tried to debug Bug 114377 and it seems to work fine. Thanks

--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -11032,10 +11032,7 @@ find_template_parameter_info::found (tree parm)
 {
   if (TREE_CODE (parm) == TREE_LIST)
     parm = TREE_VALUE (parm);
-  if (TREE_CODE (parm) == TYPE_DECL)
-    parm = TREE_TYPE (parm);
-  else
-    parm = DECL_INITIAL (parm);
+  parm = TREE_TYPE(parm);
   gcc_checking_assert (TEMPLATE_PARM_P (parm));
   return parms.contains (parm);
 }

             reply	other threads:[~2024-03-21 15:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 15:12 Centurion [this message]
2024-03-21 15:26 ` your mail Segher Boessenkool
2024-03-24  9:30   ` Centurion

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='CAKDwa5Ub7C+Cv1u_m_=NYsR6_1SgZV+O2_mxgGmvUBs4aM-HRA@mail.gmail.com' \
    --to=centurionn009@gmail.com \
    --cc=gcc-help@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).