contrib/gcc-4.4/gcc/cp/call.c
/* If the current scope isn't allowed to access DECL along
   BASETYPE_PATH, give an error.  The most derived class in
   BASETYPE_PATH is the one used to qualify DECL. DIAG_DECL is
   the declaration to use in the error diagnostic.  */
If the current scope isn't allowed to access DECL along
BASETYPE_PATH, give an error.  The most derived class in
BASETYPE_PATH is the one used to qualify DECL. DIAG_DECL is
the declaration to use in the error diagnostic.
If the current scope isn ' t allowed to access DECL along BASETYPE_PATH give an error . The most derived class in BASETYPE_PATH is the one used to qualify DECL . DIAG_DECL is the declaration to use in the error diagnostic .
bool
enforce_access (tree basetype_path, tree decl, tree diag_decl)
{
  gcc_assert (TREE_CODE (basetype_path) == TREE_BINFO);
  if (!accessible_p (basetype_path, decl, true))
    {
      if (TREE_PRIVATE (decl))
	error ("%q+#D is private", diag_decl);
      else if (TREE_PROTECTED (decl))
	error ("%q+#D is protected", diag_decl);
      else
	error ("%q+#D is inaccessible", diag_decl);
      error ("within this context");
      return false;
    }
  return true;
}
bool enforce_access ( tree basetype_path , tree decl , tree diag_decl ) { gcc_assert ( TREE_CODE ( basetype_path ) == TREE_BINFO ) ; if ( ! accessible_p ( basetype_path , decl , true ) ) { if ( TREE_PRIVATE ( decl ) ) error ( " " , diag_decl ) ; else if ( TREE_PROTECTED ( decl ) ) error ( " " , diag_decl ) ; else error ( " " , diag_decl ) ; error ( " " ) ; return false ; } return true ; }
If the current scope isn't allowed to access DECL along
BASETYPE_PATH, give an error.
If the current scope isn ' t allowed to access DECL along BASETYPE_PATH give an error .