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] |
here is a patch that implements a small enhancement for the SELECT TYPE construct, namely using an associate-name, as in:
SELECT TYPE ( x => ... )
The dots can be any CLASS-valued expression here, which makes it possible to use arbitrary expressions as a selector, and not only named variables.
What I do to accomplish this is basically: Use the associate-name 'x' like an ordinary variable, except that it gets its type from the selector expression, and insert an additional operation in front of the SELECT block which does the assignment "x => ...".
The patch works fine on the attached test case and also makes Salvatore's PSBLAS compile. It was regtested on x86_64-unknown-linux-gnu with no failures.
Ok for trunk?
+ else + gfc_check_pointer_assign (code->expr1, code->expr2);
/* Check for F03:C811. TODO: Change error message once ASSOCIATE is implemented. */ - if (expr->expr_type != EXPR_VARIABLE || expr->ref != NULL) + if (expr1->expr_type != EXPR_VARIABLE || expr1->ref != NULL)
-- Done: Arc-Bar-Cav-Ran-Rog-Sam-Tou-Val-Wiz To go: Hea-Kni-Mon-Pri
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |