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]: avoid ICE


Hi,
I've installed the attached (obvious) patch which fixes a template
ICE on some erroneous code. Now we issue an error.

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
2000-11-06  Nathan Sidwell  <nathan@codesourcery.com>

	* decl.c (build_ptrmemfunc_type): Allow error_mark_node.

Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/decl.c,v
retrieving revision 1.704
diff -c -3 -p -r1.704 decl.c
*** decl.c	2000/11/03 22:24:21	1.704
--- decl.c	2000/11/07 12:33:42
*************** build_ptrmemfunc_type (type)
*** 9215,9220 ****
--- 9215,9223 ----
    tree u;
    tree unqualified_variant = NULL_TREE;
  
+   if (type == error_mark_node)
+     return type;
+   
    /* If a canonical type already exists for this type, use it.  We use
       this method instead of type_hash_canon, because it only does a
       simple equality check on the list of field members.  */
// Build don't link:
// Copyright (C) 2000 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 7 Nov 2000 <nathan@codesourcery.com>

// We ICE'd rather than fail to instantiate.

template< typename SID, class SDR >
void k( SID sid, SDR* p,
 void (SDR::*)
 ( typename SID::T ) );

struct E { };
struct S { void f( int ); };

void f()
{
  k( E(), (S*)0, &S::f );   // ERROR - no match
} 

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