This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: g++ internal compiler error 980711 in egcs 1.1.1
- To: ian at airs dot com
- Subject: Re: g++ internal compiler error 980711 in egcs 1.1.1
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Fri, 19 Feb 1999 09:34:37 +0100
- CC: egcs-bugs at cygnus dot com, egcs-patches at cygnus dot com
- References: <19990219034336.803.qmail@comton.airs.com>
> 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;