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]

[C++ patch] Fix bug 706


Hi,
I've installed the attached obvious patch to fix bug 706 and one of
Jakub's new test cases.

built & tested on i686-pc-linux-gnu.

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
cp:
2000-11-24  Nathan Sidwell  <nathan@codesourcery.com>

	* semantics.c (finish_id_expr): If type is error_mark, return
	error_mark.

testsuite:
2000-11-24  Nathan Sidwell  <nathan@codesourcery.com>

	* g++.other/crash24.C: Adjust and remove XFAIL.
	* g++.other/crash37.C: New test.

Index: cp/semantics.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/semantics.c,v
retrieving revision 1.179
diff -c -3 -p -r1.179 semantics.c
*** semantics.c	2000/11/17 10:05:30	1.179
--- semantics.c	2000/11/24 08:48:11
*************** finish_id_expr (expr)
*** 1534,1539 ****
--- 1534,1541 ----
    if (TREE_CODE (expr) == IDENTIFIER_NODE)
      expr = do_identifier (expr, 1, NULL_TREE);
  
+   if (TREE_TYPE (expr) == error_mark_node)
+     expr = error_mark_node;
    return expr;
  }
  
Index: testsuite/g++.old-deja/g++.other/crash24.C
===================================================================
RCS file: /cvs/gcc/egcs/gcc/testsuite/g++.old-deja/g++.other/crash24.C,v
retrieving revision 1.1
diff -c -3 -p -r1.1 crash24.C
*** crash24.C	2000/11/06 12:29:02	1.1
--- crash24.C	2000/11/24 08:48:14
***************
*** 1,10 ****
  // Build don't link:
  // Origin: Jakub Jelinek <jakub@redhat.com>
  
- // crash test - XFAIL *-*-*
- 
- #include <iostream>
- 
  class foo {
   public:
     class __iterator;
--- 1,6 ----
*************** class foo {
*** 16,21 ****
  static void iteratorTest(const foo &x)
  {
     foo::const_iterator i = x.begin();		// ERROR - 
!    for (; i; ++i)				// ERROR - 
!       cout << *i;
  }
--- 12,17 ----
  static void iteratorTest(const foo &x)
  {
     foo::const_iterator i = x.begin();		// ERROR - 
!    for (; i; ++i)
!       *i;
  }
// Build don't link:

// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 23 Nov 2000 <nathan@codesourcery.com>

// bug 706. We iced when meeting a decl with type error-mark-node

class bifstream;


int main()
{
  bifstream bifs;   // ERROR - incomplete type
  if (!bifs)
    {
    }
  return 0;
}

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