This is the mail archive of the gcc-bugs@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]

PATCH for g++: internal compiler error



Jason --
  
  Here's a patch that avoids aborting on code like:

// Build don't link:

class A
{
  template<class T>T epsilon; // ERROR
};

  May I check this in, with corresponding test case?  (A peculiarity
of my current location prevents me from creating diffs for new test
cases, so I can't show that; it would be the code above.)

-- 
Mark Mitchell		mmitchell@usa.net
Stanford University	http://www.stanford.edu

Tue Mar  3 14:21:08 1998  Mark Mitchell  <mmitchell@usa.net>

	* pt.c (finish_member_template_decl): Deal more gracefully with
	invalid declarations.

Index: pt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/pt.c,v
retrieving revision 1.87
diff -c -r1.87 pt.c
*** pt.c	1998/03/03 03:24:41	1.87
--- pt.c	1998/03/03 22:17:49
***************
*** 118,131 ****
  	}
        return NULL_TREE;
      }
!   else if (DECL_TEMPLATE_INFO (decl) &&
! 	   !DECL_TEMPLATE_SPECIALIZATION (decl))
      {
!       check_member_template (DECL_TI_TEMPLATE (decl));
!       return DECL_TI_TEMPLATE (decl);
!     }
  
!   return decl;
  }
  
  /* Returns the template nesting level of the indicated class TYPE.
--- 118,138 ----
  	}
        return NULL_TREE;
      }
!   else if (DECL_TEMPLATE_INFO (decl))
      {
!       if (!DECL_TEMPLATE_SPECIALIZATION (decl))
! 	{
! 	  check_member_template (DECL_TI_TEMPLATE (decl));
! 	  return DECL_TI_TEMPLATE (decl);
! 	}
!       else
! 	return decl;
!     } 
!   else
!     cp_error ("invalid member template declaration `%D'", decl);
! 	
  
!   return error_mark_node;
  }
  
  /* Returns the template nesting level of the indicated class TYPE.


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