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]

[PATCH] Fix 10219


Hi,
I've installed this obvious patch for 10219 where a VAR_DECL has
an error_mark_node type.

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

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2003-07-02  Nathan Sidwell  <nathan@codesourcery.com>

	PR c++/10219
	* pt.c (type_unification_real): Don't unify exprs of error type.
	* tree.c (error_type): Don't die on error_type.

Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.709
diff -c -3 -p -r1.709 pt.c
*** cp/pt.c	30 Jun 2003 19:07:32 -0000	1.709
--- cp/pt.c	1 Jul 2003 08:41:34 -0000
*************** type_unification_real (tree tparms, 
*** 8830,8835 ****
--- 8830,8837 ----
  	      continue;
  	    }
  	  arg = TREE_TYPE (arg);
+ 	  if (arg == error_mark_node)
+ 	    return 1;
  	}
        
        {
Index: cp/tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/tree.c,v
retrieving revision 1.331
diff -c -3 -p -r1.331 tree.c
*** cp/tree.c	18 Jun 2003 15:22:18 -0000	1.331
--- cp/tree.c	1 Jul 2003 08:41:39 -0000
*************** tree
*** 1747,1753 ****
--- 1747,1756 ----
  error_type (tree arg)
  {
    tree type = TREE_TYPE (arg);
+   
    if (TREE_CODE (type) == ARRAY_TYPE)
+     ;
+   else if (TREE_CODE (type) == ERROR_MARK)
      ;
    else if (real_lvalue_p (arg))
      type = build_reference_type (lvalue_type (arg));
// { dg-do compile }

// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 30 Jun 2003 <nathan@codesourcery.com>

// PR c++ 10219. ICE

template <class T> void make_pair(T x);

void foo(){
  struct fps_chan_ID fps; // { dg-error "incomplete" "" }
  make_pair(fps); // { dg-error "no matching function" "" }
}

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