c++: Fix print-tree for TEMPLATE_DECL
authorJason Merrill <jason@redhat.com>
Fri, 2 Apr 2021 09:45:02 +0000 (05:45 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 5 Apr 2021 12:25:26 +0000 (08:25 -0400)
commita44a753a35542f86e82e198595ce3553f6d718f6
treef51f1d34591c29e5b8119d594c2566ee786d2bf3
parent76a7e7e706ac4c01cead3c6514322aaad88f9a63
c++: Fix print-tree for TEMPLATE_DECL

The if allows TEMPLATE_DECL, but then checking DECL_MODULE_IMPORT_P crashes
on TEMPLATE_DECL.  Fixed by stripping TEMPLATE_DECL first.

gcc/cp/ChangeLog:

* ptree.c (cxx_print_decl): Check DECL_MODULE_IMPORT_P on
template result.
gcc/cp/ptree.c