contrib/gcc-4.7/gcc/cp/class.c
/* Change the access of FDECL to ACCESS in T.  Return 1 if change was
   legit, otherwise return 0.  */
Change the access of FDECL to ACCESS in T.  Return 1 if change was
legit, otherwise return 0.
Change the access of FDECL to ACCESS in T . Return 1 if change was legit otherwise return 0 .
static int
alter_access (tree t, tree fdecl, tree access)
{
  tree elem;
  if (!DECL_LANG_SPECIFIC (fdecl))
    retrofit_lang_decl (fdecl);
  gcc_assert (!DECL_DISCRIMINATOR_P (fdecl));
  elem = purpose_member (t, DECL_ACCESS (fdecl));
  if (elem)
    {
      if (TREE_VALUE (elem) != access)
	{
	  if (TREE_CODE (TREE_TYPE (fdecl)) == FUNCTION_DECL)
	    error ("conflicting access specifications for method"
		   " %q+D, ignored", TREE_TYPE (fdecl));
	  else
	    error ("conflicting access specifications for field %qE, ignored",
		   DECL_NAME (fdecl));
	}
      else
	{
	  ;
	}
    }
  else
    {
      perform_or_defer_access_check (TYPE_BINFO (t), fdecl, fdecl);
      DECL_ACCESS (fdecl) = tree_cons (t, access, DECL_ACCESS (fdecl));
      return 1;
    }
  return 0;
}
static int alter_access ( tree t , tree fdecl , tree access ) { tree elem ; if ( ! DECL_LANG_SPECIFIC ( fdecl ) ) retrofit_lang_decl ( fdecl ) ; gcc_assert ( ! DECL_DISCRIMINATOR_P ( fdecl ) ) ; elem = purpose_member ( t , DECL_ACCESS ( fdecl ) ) ; if ( elem ) { if ( TREE_VALUE ( elem ) != access ) { if ( TREE_CODE ( TREE_TYPE ( fdecl ) ) == FUNCTION_DECL ) error ( " " " " , TREE_TYPE ( fdecl ) ) ; else error ( " " , DECL_NAME ( fdecl ) ) ; } else { ; } } else { perform_or_defer_access_check ( TYPE_BINFO ( t ) , fdecl , fdecl ) ; DECL_ACCESS ( fdecl ) = tree_cons ( t , access , DECL_ACCESS ( fdecl ) ) ; return 1 ; } return 0 ; }
Change the access of FDECL to ACCESS in T.  Return 1 if change was
legit, otherwise return 0.
Change the access of FDECL to ACCESS in T . Return 1 if change was legit otherwise return 0 .
/* They're changing the access to the same thing they changed
	     it to before.  That's OK.  */