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] Remove lenient check in is_friend


Hi

This patch remove a kludge to old parser problem when we get 
friends nested in rather complex type like

	friend T::N::bar();

where 'T' is a template parameter.  Its scope become messed up
due to mishandling inside 'enter_scope_of' in 3.3.  So we have
a chunk of code that check if the function parameters and return
type matches, ignoring scope information.  This is no longer true
for mainline.

Tested on i686-pc-linux-gnu.  OK for trunk?

--Kriang


2003-06-16  Kriang Lerdsuwanakij  <lerdsuwa@users.sourceforge.net>

	* friend.c (is_friend): Remove lenient check for nested friend
	functions.


diff -cpr gcc-main-save/gcc/cp/friend.c gcc-main-new/gcc/cp/friend.c
*** gcc-main-save/gcc/cp/friend.c	Sun Jun  8 00:07:59 2003
--- gcc-main-new/gcc/cp/friend.c	Sun Jun  8 21:00:29 2003
*************** is_friend (type, supplicant)
*** 67,82 ****
  		  if (supplicant == TREE_VALUE (friends))
  		    return 1;
  
- 		  /* Temporarily, we are more lenient to deal with
- 		     nested friend functions, for which there can be
- 		     more than one FUNCTION_DECL, despite being the
- 		     same function.  When that's fixed, this bit can
- 		     go.  */
- 		  if (DECL_FUNCTION_MEMBER_P (supplicant)
- 		      && same_type_p (TREE_TYPE (supplicant),
- 				      TREE_TYPE (TREE_VALUE (friends))))
- 		    return 1;
- 
  		  if (TREE_CODE (TREE_VALUE (friends)) == TEMPLATE_DECL
  		      && is_specialization_of (supplicant, 
  					       TREE_VALUE (friends)))
--- 67,72 ----


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