Commit e7c1c8d1 by Francois-Xavier Coudert Committed by François-Xavier Coudert

resolve.c (resolve_actual_arglist): Remove the special case for CHAR.

	* resolve.c (resolve_actual_arglist): Remove the special case for
	CHAR.
	* intrinsic.c (add_functions): Remove the special case for CHAR.

	* gfortran.dg/specifics_1.f90: Remove check for CHAR.
	* gfortran.dg/specifics_2.f90: Remove check for CHAR.
	* gfortran.dg/specifics_3.f90: Remove.

From-SVN: r119170
parent 5c386a95
2006-11-24 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* resolve.c (resolve_actual_arglist): Remove the special case for
CHAR.
* intrinsic.c (add_functions): Remove the special case for CHAR.
2006-11-22 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de> 2006-11-22 Tobias Schlueter <tobias.schlueter@physik.uni-muenchen.de>
PR fortran/29441 PR fortran/29441
......
...@@ -200,7 +200,7 @@ do_check (gfc_intrinsic_sym * specific, gfc_actual_arglist * arg) ...@@ -200,7 +200,7 @@ do_check (gfc_intrinsic_sym * specific, gfc_actual_arglist * arg)
Argument list: Argument list:
char * name of function char * name of function
int whether function is elemental int whether function is elemental
int If the function can be used as an actual argument [1] [2] int If the function can be used as an actual argument [1]
bt return type of function bt return type of function
int kind of return type of function int kind of return type of function
int Fortran standard version int Fortran standard version
...@@ -221,10 +221,7 @@ do_check (gfc_intrinsic_sym * specific, gfc_actual_arglist * arg) ...@@ -221,10 +221,7 @@ do_check (gfc_intrinsic_sym * specific, gfc_actual_arglist * arg)
determined by its presence on the 13.6 list in Fortran 2003. The determined by its presence on the 13.6 list in Fortran 2003. The
following intrinsics, which are GNU extensions, are considered allowed following intrinsics, which are GNU extensions, are considered allowed
as actual arguments: ACOSH ATANH DACOSH DASINH DATANH DCONJG DIMAG as actual arguments: ACOSH ATANH DACOSH DASINH DATANH DCONJG DIMAG
ZABS ZCOS ZEXP ZLOG ZSIN ZSQRT. ZABS ZCOS ZEXP ZLOG ZSIN ZSQRT. */
[2] The value 2 is used in this field for CHAR, which is allowed as an
actual argument in F2003, but not in F95. It is the only such
intrinsic function. */
static void static void
add_sym (const char *name, int elemental, int actual_ok, bt type, int kind, add_sym (const char *name, int elemental, int actual_ok, bt type, int kind,
...@@ -1180,7 +1177,7 @@ add_functions (void) ...@@ -1180,7 +1177,7 @@ add_functions (void)
make_generic ("ceiling", GFC_ISYM_CEILING, GFC_STD_F95); make_generic ("ceiling", GFC_ISYM_CEILING, GFC_STD_F95);
add_sym_2 ("char", 1, 2, BT_CHARACTER, dc, GFC_STD_F77, add_sym_2 ("char", ELEMENTAL, ACTUAL_NO, BT_CHARACTER, dc, GFC_STD_F77,
gfc_check_char, gfc_simplify_char, gfc_resolve_char, gfc_check_char, gfc_simplify_char, gfc_resolve_char,
i, BT_INTEGER, di, REQUIRED, kind, BT_INTEGER, di, OPTIONAL); i, BT_INTEGER, di, REQUIRED, kind, BT_INTEGER, di, OPTIONAL);
......
...@@ -881,12 +881,6 @@ resolve_actual_arglist (gfc_actual_arglist * arg) ...@@ -881,12 +881,6 @@ resolve_actual_arglist (gfc_actual_arglist * arg)
gfc_error ("Intrinsic '%s' at %L is not allowed as an " gfc_error ("Intrinsic '%s' at %L is not allowed as an "
"actual argument", sym->name, &e->where); "actual argument", sym->name, &e->where);
} }
else if (sym->attr.intrinsic && actual_ok == 2)
/* We need a special case for CHAR, which is the only intrinsic
function allowed as actual argument in F2003 and not allowed
in F95. */
gfc_notify_std (GFC_STD_F2003, "Fortran 2003: CHAR intrinsic "
"as actual argument at %L", &e->where);
if (sym->attr.contained && !sym->attr.use_assoc if (sym->attr.contained && !sym->attr.use_assoc
&& sym->ns->proc_name->attr.flavor != FL_MODULE) && sym->ns->proc_name->attr.flavor != FL_MODULE)
......
2006-11-24 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* gfortran.dg/specifics_1.f90: Remove check for CHAR.
* gfortran.dg/specifics_2.f90: Remove check for CHAR.
* gfortran.dg/specifics_3.f90: Remove.
2006-11-24 Jakub Jelinek <jakub@redhat.com> 2006-11-24 Jakub Jelinek <jakub@redhat.com>
PR c/29955 PR c/29955
...@@ -145,12 +145,6 @@ subroutine test_len(fn,val,res) ...@@ -145,12 +145,6 @@ subroutine test_len(fn,val,res)
if (res .ne. fn(val)) call abort if (res .ne. fn(val)) call abort
end subroutine end subroutine
subroutine test_char(fn,val,res)
integer val
character(len=1) fn, res
if (res .ne. fn(val)) call abort
end subroutine
subroutine test_index(fn,val1,val2,res) subroutine test_index(fn,val1,val2,res)
integer fn, res integer fn, res
character(len=*) val1, val2 character(len=*) val1, val2
...@@ -235,7 +229,6 @@ program specifics ...@@ -235,7 +229,6 @@ program specifics
intrinsic mod intrinsic mod
intrinsic len intrinsic len
intrinsic index intrinsic index
intrinsic char
intrinsic aimag intrinsic aimag
intrinsic dimag intrinsic dimag
...@@ -319,7 +312,6 @@ program specifics ...@@ -319,7 +312,6 @@ program specifics
call test_iabs (iabs, -7, iabs(-7)) call test_iabs (iabs, -7, iabs(-7))
call test_idim (mod, 5, 2, mod(5,2)) call test_idim (mod, 5, 2, mod(5,2))
call test_len (len, "foobar", len("foobar")) call test_len (len, "foobar", len("foobar"))
call test_char (char, 47, char(47))
call test_index (index, "foobarfoobar", "bar", index("foobarfoobar","bar")) call test_index (index, "foobarfoobar", "bar", index("foobarfoobar","bar"))
end program end program
......
! { dg-do compile } ! { dg-do compile }
! This is the list of intrinsics allowed as actual arguments ! This is the list of intrinsics allowed as actual arguments
intrinsic abs,acos,acosh,aimag,aint,alog,alog10,amod,anint,asin,asinh,atan,& intrinsic abs,acos,acosh,aimag,aint,alog,alog10,amod,anint,asin,asinh,atan,&
atan2,atanh,cabs,ccos,cexp,char,clog,conjg,cos,cosh,csin,csqrt,dabs,dacos,& atan2,atanh,cabs,ccos,cexp,clog,conjg,cos,cosh,csin,csqrt,dabs,dacos,&
dacosh,dasin,dasinh,datan,datan2,datanh,dconjg,dcos,dcosh,ddim,dexp,dim,& dacosh,dasin,dasinh,datan,datan2,datanh,dconjg,dcos,dcosh,ddim,dexp,dim,&
dimag,dint,dlog,dlog10,dmod,dnint,dprod,dsign,dsin,dsinh,dsqrt,dtan,dtanh,& dimag,dint,dlog,dlog10,dmod,dnint,dprod,dsign,dsin,dsinh,dsqrt,dtan,dtanh,&
exp,iabs,idim,idnint,index,isign,len,mod,nint,sign,sin,sinh,sqrt,tan,& exp,iabs,idim,idnint,index,isign,len,mod,nint,sign,sin,sinh,sqrt,tan,&
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
call foo(cabs) call foo(cabs)
call foo(ccos) call foo(ccos)
call foo(cexp) call foo(cexp)
call foo(char)
call foo(clog) call foo(clog)
call foo(conjg) call foo(conjg)
call foo(cos) call foo(cos)
......
! { dg-do compile }
! { dg-options "-std=f95" }
intrinsic char
call foo(char) ! { dg-error "Fortran 2003: CHAR intrinsic as actual argument" }
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment