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]

[C++ PATCH] Fix 11871


I've installed this obvious patch for a regression I caused. I misread
some code when reorganising it.

booted & tested on i686-pc-linus-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-08-26  Nathan Sidwell  <nathan@codesourcery.com>

	PR c++/11871
	* decl.c (push_class_level_binding): Correct old_decl value from
	my 2003-07-29 reorganization.

Index: cp/decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1117
diff -c -3 -p -r1.1117 decl.c
*** cp/decl.c	25 Aug 2003 15:47:39 -0000	1.1117
--- cp/decl.c	26 Aug 2003 08:54:47 -0000
*************** push_class_level_binding (tree name, tre
*** 4282,4292 ****
  	  if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval)
  	      && !(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x)))
  	    {
  	      BINDING_TYPE (binding) = bval;
  	      BINDING_VALUE (binding) = NULL_TREE;
  	      INHERITED_VALUE_BINDING_P (binding) = 0;
  	    }
! 	  old_decl = bval;
  	}
        else if (TREE_CODE (x) == OVERLOAD && is_overloaded_fn (bval))
  	old_decl = bval;
--- 4282,4294 ----
  	  if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval)
  	      && !(TREE_CODE (x) == TYPE_DECL && DECL_ARTIFICIAL (x)))
  	    {
+ 	      old_decl = BINDING_TYPE (binding);
  	      BINDING_TYPE (binding) = bval;
  	      BINDING_VALUE (binding) = NULL_TREE;
  	      INHERITED_VALUE_BINDING_P (binding) = 0;
  	    }
! 	  else
! 	    old_decl = bval;
  	}
        else if (TREE_CODE (x) == OVERLOAD && is_overloaded_fn (bval))
  	old_decl = bval;
// { dg-do compile }

// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 25 Aug 2003 <nathan@codesourcery.com>
// Origin pr 11871 Dirk Mueller <mueller@kde.org>

// PR c++/11871 Regression

namespace std
{
  class A
  {
  public:
    enum result
    {
      ok
    };
  };

  template<typename T> class B : public A
    {
    public:
      typedef A::result	result;
    };
}

int main()
{
  for(float result = 1.0;;);
}


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