aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/error.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2009-04-07 13:48:52 -0400
committerJason Merrill <jason@gcc.gnu.org>2009-04-07 13:48:52 -0400
commit6ea2bd47dd50fdf50e5b71e7349dae094f2920fe (patch)
treeaaa87a15f5942f4f114e17e7f79c23571f506e9b /gcc/cp/error.c
parenta2dc5812ff7b8d195399c4f9513dcf0376eba4d5 (diff)
downloadgcc-6ea2bd47dd50fdf50e5b71e7349dae094f2920fe.zip
gcc-6ea2bd47dd50fdf50e5b71e7349dae094f2920fe.tar.gz
gcc-6ea2bd47dd50fdf50e5b71e7349dae094f2920fe.tar.bz2
re PR c++/25185 (deep typedef substitution in error message)
PR c++/25185 * c-common.h, c-common.c: Add flag_pretty_templates. * c-opts.c (c_common_handle_option): Set it. * c.opt: Add -fno-pretty-templates. * doc/invoke.texi (C++ Dialect Options): Likewise. * error.c (dump_function_decl): Don't pretty-print templates if -fno-pretty-templates. (count_non_default_template_args): Print all args if -fno-pretty-templates. From-SVN: r145697
Diffstat (limited to 'gcc/cp/error.c')
-rw-r--r--gcc/cp/error.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index a97017a..fc32d99 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -163,7 +163,7 @@ count_non_default_template_args (tree args, tree params)
int n = TREE_VEC_LENGTH (args);
int last;
- if (params == NULL_TREE)
+ if (params == NULL_TREE || !flag_pretty_templates)
return n;
for (last = n - 1; last >= 0; --last)
@@ -1206,7 +1206,8 @@ dump_function_decl (tree t, int flags)
exceptions = TYPE_RAISES_EXCEPTIONS (TREE_TYPE (t));
/* Pretty print template instantiations only. */
- if (DECL_USE_TEMPLATE (t) && DECL_TEMPLATE_INFO (t))
+ if (DECL_USE_TEMPLATE (t) && DECL_TEMPLATE_INFO (t)
+ && flag_pretty_templates)
{
tree tmpl;