This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ Patch] PR 33210


Hi,

I have this snippet, directly inspired from corresponding code in
error.c, to deal with BOUND_TEMPLATE_TEMPLATE_PARM.

Tested x86_64-linux, Ok for mainline?

Paolo.

/////////////////
/cp
2007-08-31  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33210
	* cxx-pretty-print.c (pp_cxx_unqualified_id): Deal with
	BOUND_TEMPLATE_TEMPLATE_PARM.

/testsuite
2007-08-31  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33210
	* g++.dg/template/error30.C: New.
Index: testsuite/g++.dg/template/error30.C
===================================================================
*** testsuite/g++.dg/template/error30.C	(revision 0)
--- testsuite/g++.dg/template/error30.C	(revision 0)
***************
*** 0 ****
--- 1,5 ----
+ // PR c++/33210
+ 
+ template<int> struct A;
+ 
+ template<template<typename> class B> A<B<int>::x> operator() (); // { dg-error "A<B<int>::x>" }
Index: cp/cxx-pretty-print.c
===================================================================
*** cp/cxx-pretty-print.c	(revision 127961)
--- cp/cxx-pretty-print.c	(working copy)
*************** pp_cxx_unqualified_id (cxx_pretty_printe
*** 190,195 ****
--- 190,197 ----
      case RECORD_TYPE:
      case UNION_TYPE:
      case ENUMERAL_TYPE:
+     case TYPENAME_TYPE:
+     case UNBOUND_CLASS_TEMPLATE:
        pp_cxx_unqualified_id (pp, TYPE_NAME (t));
        break;
  
*************** pp_cxx_unqualified_id (cxx_pretty_printe
*** 205,213 ****
        pp_cxx_unqualified_id (pp, TEMPLATE_PARM_DECL (t));
        break;
  
!     case TYPENAME_TYPE:
!     case UNBOUND_CLASS_TEMPLATE:
!       pp_cxx_unqualified_id (pp, TYPE_NAME (t));
        break;
  
      default:
--- 207,218 ----
        pp_cxx_unqualified_id (pp, TEMPLATE_PARM_DECL (t));
        break;
  
!     case BOUND_TEMPLATE_TEMPLATE_PARM:
!       pp_cxx_cv_qualifier_seq (pp, t);
!       pp_cxx_unqualified_id (pp, TYPE_IDENTIFIER (t));
!       pp_cxx_begin_template_argument_list (pp);
!       pp_cxx_template_argument_list (pp, TYPE_TI_ARGS (t));
!       pp_cxx_end_template_argument_list (pp);
        break;
  
      default:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]