]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: fix cxx_print_type's template-info dumping
authorPatrick Palka <ppalka@redhat.com>
Tue, 19 Sep 2023 18:38:10 +0000 (14:38 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 19 Sep 2023 18:38:10 +0000 (14:38 -0400)
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.

gcc/cp/ptree.cc

index b4001486701f12b579b6dfc7a9ffd66fffb772a1..32c5b5280dcb69753f734c90e6e0c3d5e4307d69 100644 (file)
@@ -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))
     {