This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

[Patch, Fortran, OOP] PR 47767: SELECT TYPE fails to execute correct TYPE IS block


Hi all,

here is the fix for a wrong-code OOP problem, where the vtab symbols
would not be passed on correctly through modules with PRIVATE
declaration. The vtabs are basically meant to be 'global' symbols,
which are usually defined in the same module as the corresponding
derived type and should be available everywhere else.

Therefore, the fix for this PR was to make the vtabs and vtypes public
in every module they are found in, even if there is a PRIVATE
statement. To accomplish this, I constructed a new function
'gfc_check_symbol_access', which is a descendant of 'gfc_check_access'
and in addition checks the 'vtab' and 'vtype' attributes. This
function I could substitute for 'gfc_check_access' in most places
(which in turn could be made static, and renamed), except for a few,
where it's used in a different way.

The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus



2011-02-17  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/47767
	* gfortran.h (gfc_check_access): Removed prototype.
	(gfc_check_symbol_access): Added prototype.
	* module.c (gfc_check_access): Renamed to 'check_access', made static.
	(gfc_check_symbol_access): New function, basically a shortcut for
	'check_access'.
	(write_dt_extensions,write_symbol0,write_generic,write_symtree): Use
	'gfc_check_symbol_access'.
	(write_operator,write_module): Renamed 'gfc_check_access'.
	* resolve.c (resolve_fl_procedure,resolve_fl_derived,
	resolve_fl_namelist,resolve_symbol,resolve_fntype): Use
	'gfc_check_symbol_access'.

2011-02-17  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/47767
	* gfortran.dg/class_40.f03: New.

Attachment: pr47767_v2.diff
Description: Binary data

Attachment: class_40.f03
Description: Binary data


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