aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 0d6375e..ecb41e8 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -701,7 +701,6 @@ class_key_or_enum_as_string (tree t)
static void
dump_aggr_type (cxx_pretty_printer *pp, tree t, int flags)
{
- tree name;
const char *variety = class_key_or_enum_as_string (t);
int typdef = 0;
int tmplate = 0;
@@ -711,23 +710,23 @@ dump_aggr_type (cxx_pretty_printer *pp, tree t, int flags)
if (flags & TFF_CLASS_KEY_OR_ENUM)
pp_cxx_ws_string (pp, variety);
- name = TYPE_NAME (t);
+ tree decl = TYPE_NAME (t);
- if (name)
+ if (decl)
{
- typdef = (!DECL_ARTIFICIAL (name)
+ typdef = (!DECL_ARTIFICIAL (decl)
/* An alias specialization is not considered to be a
typedef. */
&& !alias_template_specialization_p (t, nt_opaque));
if ((typdef
&& ((flags & TFF_CHASE_TYPEDEF)
- || (!flag_pretty_templates && DECL_LANG_SPECIFIC (name)
- && DECL_TEMPLATE_INFO (name))))
- || DECL_SELF_REFERENCE_P (name))
+ || (!flag_pretty_templates && DECL_LANG_SPECIFIC (decl)
+ && DECL_TEMPLATE_INFO (decl))))
+ || DECL_SELF_REFERENCE_P (decl))
{
t = TYPE_MAIN_VARIANT (t);
- name = TYPE_NAME (t);
+ decl = TYPE_NAME (t);
typdef = 0;
}
@@ -737,7 +736,7 @@ dump_aggr_type (cxx_pretty_printer *pp, tree t, int flags)
|| PRIMARY_TEMPLATE_P (CLASSTYPE_TI_TEMPLATE (t)));
if (! (flags & TFF_UNQUALIFIED_NAME))
- dump_scope (pp, CP_DECL_CONTEXT (name), flags | TFF_SCOPE);
+ dump_scope (pp, CP_DECL_CONTEXT (decl), flags | TFF_SCOPE);
flags &= ~TFF_UNQUALIFIED_NAME;
if (tmplate)
{
@@ -747,9 +746,8 @@ dump_aggr_type (cxx_pretty_printer *pp, tree t, int flags)
while (DECL_TEMPLATE_INFO (tpl))
tpl = DECL_TI_TEMPLATE (tpl);
- name = tpl;
+ decl = tpl;
}
- name = DECL_NAME (name);
}
if (LAMBDA_TYPE_P (t))
@@ -762,7 +760,7 @@ dump_aggr_type (cxx_pretty_printer *pp, tree t, int flags)
flags);
pp_greater (pp);
}
- else if (!name || IDENTIFIER_ANON_P (name))
+ else if (!decl || IDENTIFIER_ANON_P (DECL_NAME (decl)))
{
if (flags & TFF_CLASS_KEY_OR_ENUM)
pp_string (pp, M_("<unnamed>"));
@@ -770,7 +768,7 @@ dump_aggr_type (cxx_pretty_printer *pp, tree t, int flags)
pp_printf (pp, M_("<unnamed %s>"), variety);
}
else
- pp_cxx_tree_identifier (pp, name);
+ pp_cxx_tree_identifier (pp, DECL_NAME (decl));
if (tmplate)
dump_template_parms (pp, TYPE_TEMPLATE_INFO (t),