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]

Re: g++ internal compiler error 980711 in egcs 1.1.1


> The input file is erroneous.  The particular aspect which causes this
> crash is that there is a single colon in the name foo::cc:fn where
> there should be a double colon.  However, the compiler should produce
> an error message, rather than crashing in this fashion.

Thanks for the report. The patch is simple: just accept the namespace,
instead of asserting that there shouldn't be one.

Regards,
Martin

1999-02-19  Martin von Löwis  <loewis@informatik.hu-berlin.de>

	* class.c (push_nested_class): Allow namespaces.

//Build don't link:
namespace foo
{
  class c
  {
  };
};

int
foo::c:fn ()  // ERROR - syntax error
{
}

Index: class.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/class.c,v
retrieving revision 1.129
diff -c -p -r1.129 class.c
*** class.c	1999/02/16 11:32:43	1.129
--- class.c	1999/02/19 08:30:15
*************** push_nested_class (type, modify)
*** 4906,4914 ****
  {
    tree context;
  
!   my_friendly_assert (!type || TREE_CODE (type) != NAMESPACE_DECL, 980711);
! 
    if (type == NULL_TREE || type == error_mark_node || ! IS_AGGR_TYPE (type)
        || TREE_CODE (type) == TEMPLATE_TYPE_PARM
        || TREE_CODE (type) == TEMPLATE_TEMPLATE_PARM)
      return;
--- 4906,4914 ----
  {
    tree context;
  
!   /* A namespace might be passed in error cases, like A::B:C.  */
    if (type == NULL_TREE || type == error_mark_node || ! IS_AGGR_TYPE (type)
+       || TREE_CODE (type) == NAMESPACE_DECL
        || TREE_CODE (type) == TEMPLATE_TYPE_PARM
        || TREE_CODE (type) == TEMPLATE_TEMPLATE_PARM)
      return;

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