public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-4151] c++: fix cxx_print_type's template-info dumping
@ 2023-09-19 18:38 Patrick Palka
  0 siblings, 0 replies; only message in thread
From: Patrick Palka @ 2023-09-19 18:38 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b9912332c5b6fc9433ee11f5488acad117868888

commit r14-4151-gb9912332c5b6fc9433ee11f5488acad117868888
Author: Patrick Palka <ppalka@redhat.com>
Date:   Tue Sep 19 14:38:10 2023 -0400

    c++: fix cxx_print_type's template-info dumping
    
    Unlike DECL_TEMPLATE_INFO which is stored in DECL_LANG_SPECIFIC,
    TYPE_TEMPLATE_INFO isn't stored in TYPE_LANG_SPECIFIC, so we don't
    need to check for both in cxx_print_type.  This fixes dumping the
    template-info of ENUMERAL_TYPE and BOUND_TEMPLATE_TEMPLATE_PARM,
    which seem to never have TYPE_LANG_SPECIFIC.
    
    gcc/cp/ChangeLog:
    
            * ptree.cc (cxx_print_type): Remove TYPE_LANG_SPECIFIC
            test guarding TYPE_TEMPLATE_INFO.

Diff:
---
 gcc/cp/ptree.cc | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/gcc/cp/ptree.cc b/gcc/cp/ptree.cc
index b4001486701..32c5b5280dc 100644
--- a/gcc/cp/ptree.cc
+++ b/gcc/cp/ptree.cc
@@ -141,9 +141,8 @@ cxx_print_decl (FILE *file, tree node, int indent)
 void
 cxx_print_type (FILE *file, tree node, int indent)
 {
-  if (TYPE_LANG_SPECIFIC (node)
-      && TYPE_TEMPLATE_INFO (node))
-    print_node (file, "template-info", TYPE_TEMPLATE_INFO (node), indent + 4);
+  if (tree ti = TYPE_TEMPLATE_INFO (node))
+    print_node (file, "template-info", ti, indent + 4);
 
   switch (TREE_CODE (node))
     {

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-19 18:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-19 18:38 [gcc r14-4151] c++: fix cxx_print_type's template-info dumping Patrick Palka

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).