Commit 21779d2e by Daniel Franke Committed by Daniel Franke

re PR fortran/42354 (Invalidly accepts C_LOC in init expressions)

gcc/fortran/:
2009-12-14  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/42354
	* expr.c (check_init_expr): Do not check for specification functions.

gcc/testsuite/:
2009-12-14  Daniel Franke  <franke.daniel@gmail.com>

	PR fortran/42354
	* gfortran.dg/iso_c_binding_init_expr.f03: New.
	* gfortran.dg/intrinsic_std_1.f90: Fixed expected error message.
	* gfortran.dg/function_kinds_5.f90: Likewise.
	* gfortran.dg/selected_char_kind_3.f90: Likewise.

From-SVN: r155234
parent 4e25ca6b
2009-12-14 Daniel Franke <franke.daniel@gmail.com>
PR fortran/42354
* expr.c (check_init_expr): Do not check for specification functions.
2009-12-11 Janus Weil <janus@gcc.gnu.org>
PR fortran/42257
......
......@@ -2286,7 +2286,6 @@ check_init_expr (gfc_expr *e)
case EXPR_FUNCTION:
t = FAILURE;
if ((m = check_specification_function (e)) != MATCH_YES)
{
gfc_intrinsic_sym* isym;
gfc_symbol* sym;
......@@ -2296,7 +2295,7 @@ check_init_expr (gfc_expr *e)
|| (m = gfc_intrinsic_func_interface (e, 0)) != MATCH_YES)
{
gfc_error ("Function '%s' in initialization expression at %L "
"must be an intrinsic or a specification function",
"must be an intrinsic function",
e->symtree->n.sym->name, &e->where);
break;
}
......
2009-12-14 Daniel Franke <franke.daniel@gmail.com>
PR fortran/42354
* gfortran.dg/iso_c_binding_init_expr.f03: New.
* gfortran.dg/intrinsic_std_1.f90: Fixed expected error message.
* gfortran.dg/function_kinds_5.f90: Likewise.
* gfortran.dg/selected_char_kind_3.f90: Likewise.
2009-12-14 Dominique d'Humieres <dominiq@lps.ens.fr>
* gfortran.dg/boz_15.f90: Fix typos.
......
......@@ -5,6 +5,6 @@
!
! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
!
real (bad_kind(0d0)) function foo () ! { dg-error "must be an intrinsic or" }
real (bad_kind(0d0)) function foo () ! { dg-error "must be an intrinsic function" }
foo = real (kind (foo))
end function
......@@ -32,7 +32,7 @@ END SUBROUTINE implicit_type
SUBROUTINE specification_expression
CHARACTER(KIND=selected_char_kind("ascii")) :: x
! { dg-error "specification function" "" { target "*-*-*" } 34 }
! { dg-error "must be an intrinsic function" "" { target "*-*-*" } 34 }
! { dg-warning "Fortran 2003" "" { target "*-*-*" } 34 }
END SUBROUTINE specification_expression
......
! { dg-do "compile" }
! PR fortran/42354
use iso_c_binding
implicit none
integer, target :: a
type t
type(c_ptr) :: ptr = c_loc(a) ! { dg-error "must be an intrinsic function" }
end type t
type(c_ptr) :: ptr2 = c_loc(a) ! { dg-error "must be an intrinsic function" }
end
......@@ -4,7 +4,7 @@
! Check that SELECTED_CHAR_KIND is rejected with -std=f95
!
implicit none
character(kind=selected_char_kind("ascii")) :: s ! { dg-error "must be an intrinsic or a specification function" }
character(kind=selected_char_kind("ascii")) :: s ! { dg-error "must be an intrinsic function" }
s = "" ! { dg-error "has no IMPLICIT type" }
print *, s
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