mirror of git://gcc.gnu.org/git/gcc.git
dummy_optional_arg.f90: New test.
2010-09-09 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.dg/dummy_optional_arg.f90: New test. 2010-09-09 Steven G. Kargl <kargl@gcc.gnu.org> * fortran/expr.c (check_inquiry): OPTIONAL attribute is not allowed for dummy argument that appears in a specification statement. From-SVN: r164120
This commit is contained in:
parent
b1012ca4be
commit
26865ab4e8
|
@ -1,3 +1,8 @@
|
||||||
|
2010-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||||
|
|
||||||
|
* fortran/expr.c (check_inquiry): OPTIONAL attribute is not allowed
|
||||||
|
for dummy argument that appears in a specification statement.
|
||||||
|
|
||||||
2010-09-09 Mikael Morin <mikael@gcc.gnu.org>
|
2010-09-09 Mikael Morin <mikael@gcc.gnu.org>
|
||||||
|
|
||||||
* trans-array.c (gfc_get_array_ref_dim): New function.
|
* trans-array.c (gfc_get_array_ref_dim): New function.
|
||||||
|
|
|
@ -2305,6 +2305,12 @@ check_inquiry (gfc_expr *e, int not_restricted)
|
||||||
&& ap->expr->expr_type != EXPR_VARIABLE
|
&& ap->expr->expr_type != EXPR_VARIABLE
|
||||||
&& check_restricted (ap->expr) == FAILURE)
|
&& check_restricted (ap->expr) == FAILURE)
|
||||||
return MATCH_ERROR;
|
return MATCH_ERROR;
|
||||||
|
|
||||||
|
if (not_restricted == 0
|
||||||
|
&& ap->expr->expr_type == EXPR_VARIABLE
|
||||||
|
&& ap->expr->symtree->n.sym->attr.dummy
|
||||||
|
&& ap->expr->symtree->n.sym->attr.optional)
|
||||||
|
return MATCH_NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
return MATCH_YES;
|
return MATCH_YES;
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
2010-09-09 Steven G. Kargl <kargl@gcc.gnu.org>
|
||||||
|
|
||||||
|
* gfortran.dg/dummy_optional_arg.f90: New test.
|
||||||
|
|
||||||
2010-09-08 Jan Hubicka <jh@suse.cz>
|
2010-09-08 Jan Hubicka <jh@suse.cz>
|
||||||
|
|
||||||
PR tree-optimization/45598
|
PR tree-optimization/45598
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
! { dg-do compile }
|
||||||
|
! PR fortran/45495
|
||||||
|
!
|
||||||
|
! Code originally submitted by Philip Mason <pmason at ricardo dot com>
|
||||||
|
!
|
||||||
|
function jack(aa)
|
||||||
|
character(len=*), intent(in) :: aa
|
||||||
|
optional :: aa
|
||||||
|
character(len=len(aa)+1) :: jack ! { dg-error "cannot be OPTIONAL" }
|
||||||
|
jack = ''
|
||||||
|
end function jack
|
||||||
|
|
||||||
|
function diane(aa)
|
||||||
|
character(len=*), intent(out) :: aa
|
||||||
|
character(len=len(aa)+1) :: diane
|
||||||
|
diane = '012345678901'
|
||||||
|
aa = 'abcdefghijklmn'
|
||||||
|
end function diane
|
Loading…
Reference in New Issue