diff options
author | Jason Merrill <jason@redhat.com> | 2009-04-08 12:08:15 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2009-04-08 12:08:15 -0400 |
commit | f6f5e3a1cc294a064bf87250db3dee449a24f278 (patch) | |
tree | 79752b2a66e9422d70efe39125b3a379bbca76e9 /gcc/cp | |
parent | b568955d9c5ac37908ca4f3b808a5d58079c3196 (diff) | |
download | gcc-f6f5e3a1cc294a064bf87250db3dee449a24f278.zip gcc-f6f5e3a1cc294a064bf87250db3dee449a24f278.tar.gz gcc-f6f5e3a1cc294a064bf87250db3dee449a24f278.tar.bz2 |
re PR c++/25185 (deep typedef substitution in error message)
PR c++/25185
* error.c (dump_aggr_type): Chase template typedefs if
-fno-pretty-templates.
From-SVN: r145753
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/error.c | 14 |
2 files changed, 17 insertions, 3 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 22d1ced..b11e004 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-04-08 Jason Merrill <jason@redhat.com> + + PR c++/25185 + * error.c (dump_aggr_type): Chase template typedefs if + -fno-pretty-templates. + 2009-04-08 Dodji Seketeli <dodji@redhat.com> PR c++/39637 diff --git a/gcc/cp/error.c b/gcc/cp/error.c index fc32d99..9c2e7e5 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -537,14 +537,22 @@ dump_aggr_type (tree t, int flags) if (flags & TFF_CLASS_KEY_OR_ENUM) pp_cxx_identifier (cxx_pp, variety); - if (flags & TFF_CHASE_TYPEDEF) - t = TYPE_MAIN_VARIANT (t); - name = TYPE_NAME (t); if (name) { typdef = !DECL_ARTIFICIAL (name); + + if (typdef + && ((flags & TFF_CHASE_TYPEDEF) + || (!flag_pretty_templates && DECL_LANG_SPECIFIC (name) + && DECL_TEMPLATE_INFO (name)))) + { + t = TYPE_MAIN_VARIANT (t); + name = TYPE_NAME (t); + typdef = 0; + } + tmplate = !typdef && TREE_CODE (t) != ENUMERAL_TYPE && TYPE_LANG_SPECIFIC (t) && CLASSTYPE_TEMPLATE_INFO (t) && (TREE_CODE (CLASSTYPE_TI_TEMPLATE (t)) != TEMPLATE_DECL |