diff options
author | Dodji Seketeli <dodji@redhat.com> | 2009-12-04 07:38:42 +0000 |
---|---|---|
committer | Dodji Seketeli <dodji@gcc.gnu.org> | 2009-12-04 08:38:42 +0100 |
commit | 38a15b40eacfa2d814c7ef064eee12a24785626b (patch) | |
tree | 75b21d5a96abd27bb388e686e588c3820174b75b | |
parent | 25a31608991aef2f4f9d6090bb02df621e1aac58 (diff) | |
download | gcc-38a15b40eacfa2d814c7ef064eee12a24785626b.zip gcc-38a15b40eacfa2d814c7ef064eee12a24785626b.tar.gz gcc-38a15b40eacfa2d814c7ef064eee12a24785626b.tar.bz2 |
re PR c++/42218 (Broken diagnostic: 'tree_vec' not supported by pp_c_expression)
Fix PR c++/42218
gcc/cp/ChangeLog:
PR c++/42218
* cxx-pretty-print.c (pp_cxx_unqualified_id): Print only innermost
template arguments.
gcc/testsuite/ChangeLog:
PR c++/42218
* g++.dg/other/error33.C: New test.
From-SVN: r154972
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/cxx-pretty-print.c | 3 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/other/error33.C | 11 |
4 files changed, 24 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index cdbd1c4..0c96a78 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-12-04 Dodji Seketeli <dodji@redhat.com> + + PR c++/42218 + * cxx-pretty-print.c (pp_cxx_unqualified_id): Print only innermost + template arguments. + 2009-12-03 Jason Merrill <jason@redhat.com> PR c++/41611 diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c index 305b7ed..5ef84fe 100644 --- a/gcc/cp/cxx-pretty-print.c +++ b/gcc/cp/cxx-pretty-print.c @@ -203,7 +203,8 @@ pp_cxx_unqualified_id (cxx_pretty_printer *pp, tree t) if (CLASS_TYPE_P (t) && CLASSTYPE_USE_TEMPLATE (t)) { pp_cxx_begin_template_argument_list (pp); - pp_cxx_template_argument_list (pp, CLASSTYPE_TI_ARGS (t)); + pp_cxx_template_argument_list (pp, INNERMOST_TEMPLATE_ARGS + (CLASSTYPE_TI_ARGS (t))); pp_cxx_end_template_argument_list (pp); } break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index cc9a74e..956d778 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-12-04 Dodji Seketeli <dodji@redhat.com> + + PR c++/42218 + * g++.dg/other/error33.C: New test. + 2009-12-03 Jason Merrill <jason@redhat.com> * g++.dg/abi/guard2.C: Run on *-*-linux* rather than x86-*-* diff --git a/gcc/testsuite/g++.dg/other/error33.C b/gcc/testsuite/g++.dg/other/error33.C new file mode 100644 index 0000000..48fca70 --- /dev/null +++ b/gcc/testsuite/g++.dg/other/error33.C @@ -0,0 +1,11 @@ +// Contributed by Dodji Seketeli <dodji@redhat.com> +// Origin: PR c++/42218 +// { dg-do compile } + +template<int> struct A +{ + template<int> struct B; +}; + +int i = A<0>::B<0>::X::Y; // { dg-error "'A<0>::B<0>::X' has not been declared" } + |