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]

RFA: 3.3 C++ PATCH to instantiate_class_template for c++/10661


10661 is a bug whereby implicit typename is causing us to try to
instantiate a nested class without instantiating its enclosing class,
causing an ICE.  This patch fixes the testcase.  We could also give a
diagnostic here, so that people know that their code is ill-formed, but
that seems less safe than this patch.  Is this OK for 3.3?

I'm thinking that on the trunk I'll add an abort for this case.

2003-05-08  Jason Merrill  <jason@redhat.com>

	PR c++/10661
	* pt.c (instantiate_class_template): Also instantiate our
	enclosing class.

*** pt.c.~1~	2003-05-08 11:42:09.000000000 -0400
--- pt.c	2003-05-08 14:08:20.000000000 -0400
*************** instantiate_class_template (type)
*** 5360,5365 ****
--- 5360,5369 ----
    if (ANON_AGGR_TYPE_P (pattern))
      SET_ANON_AGGR_TYPE_P (type);
  
+   if (DECL_CLASS_SCOPE_P (TYPE_MAIN_DECL (pattern)))
+     /* First instantiate our enclosing class.  */
+     complete_type (TYPE_CONTEXT (type));
+ 
    if (TYPE_BINFO_BASETYPES (pattern))
      {
        tree base_list = NULL_TREE;

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