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]

Re: [C++ PATCH] Fix lookup in typedefs of the currently open class (PR c++/33516)


On Thu, Nov 01, 2007 at 02:53:00PM -0400, Jason Merrill wrote:
> Jakub Jelinek wrote:
> >+	  if (!COMPLETE_TYPE_P (new_scope)
> >+	      && TYPE_MAIN_VARIANT (new_scope) != new_scope
> >+	      && currently_open_class (new_scope))
> >+	    new_scope = TYPE_MAIN_VARIANT (new_scope);
> 
> It seems unnecessary to have so many tests.  Specifically the second 
> test doesn't do anything.  And I might move the !COMPLETE_TYPE_P test 
> inside currently_open_class.

Both tests were there just to avoid the more expensive currently_open_class
call.  But if you think it is not too expensive and can be called
unconditionally, so be it.

	Jakub


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