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 1546


Hi,
I've installed this obvious patch for bug 1546. Check array is not
of unknown sized first.

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

	* pt.c (unify): Check array has a domain, before checking
	whether it is variable sized.

Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/pt.c,v
retrieving revision 1.499
diff -c -3 -p -r1.499 pt.c
*** pt.c	2001/01/08 14:41:01	1.499
--- pt.c	2001/01/11 09:10:22
*************** unify (tparms, targs, parm, arg, strict)
*** 8514,8519 ****
--- 8513,8519 ----
  	 here.  */
        if (TREE_CODE (arg) == ARRAY_TYPE 
  	  && !uses_template_parms (arg)
+ 	  && TYPE_DOMAIN (arg)
  	  && (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (arg)))
  	      != INTEGER_CST))
  	return 1;
// Build don't link:

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

// Bug 1546. We ICE'd trying to unify an array of unknown bound,
// checking to see if it was a variable sized array.

template <class _Tp> class allocator {};

template <class _Tp, class _Allocator>
struct _Alloc_traits
{
  static const bool _S_instanceless = false;
};

template <class _Tp, class _Tp1>
struct _Alloc_traits<_Tp, allocator<_Tp1> >
{
  static const bool _S_instanceless = true;
};

typedef char state [];
bool y = _Alloc_traits<state, allocator<state> >::_S_instanceless;

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