mirror of git://gcc.gnu.org/git/gcc.git
re PR fortran/57549 (Bogus error with array constructor with derived-type typespec)
2013-06-07 Tobias Burnus <burnus@net-b.de>
PR fortran/57549
* array.c (gfc_match_array_constructor): Call
gfc_match_type_spec instead of gfc_match_decl_type_spec.
* match.c (gfc_match_type_spec): Renamed from match_type_spec.
(gfc_match_type_is, gfc_match_allocate): Update call.
* match.h (gfc_match_type_spec): Add prototype.
2013-06-07 Tobias Burnus <burnus@net-b.de>
PR fortran/57549
* gfortran.dg/array_constructor_48.f90: New.
* gfortran.dg/array_constructor_type_14.f03: Correct test case.
* gfortran.dg/array_constructor_type_15.f03: Ditto.
From-SVN: r199820
This commit is contained in:
parent
b5e0425c7c
commit
894460a754
|
|
@ -1,3 +1,12 @@
|
||||||
|
2013-06-07 Tobias Burnus <burnus@net-b.de>
|
||||||
|
|
||||||
|
PR fortran/57549
|
||||||
|
* array.c (gfc_match_array_constructor): Call
|
||||||
|
gfc_match_type_spec instead of gfc_match_decl_type_spec.
|
||||||
|
* match.c (gfc_match_type_spec): Renamed from match_type_spec.
|
||||||
|
(gfc_match_type_is, gfc_match_allocate): Update call.
|
||||||
|
* match.h (gfc_match_type_spec): Add prototype.
|
||||||
|
|
||||||
2013-06-07 Tobias Burnus <burnus@net-b.de>
|
2013-06-07 Tobias Burnus <burnus@net-b.de>
|
||||||
|
|
||||||
PR fortran/57556
|
PR fortran/57556
|
||||||
|
|
|
||||||
|
|
@ -1073,7 +1073,7 @@ gfc_match_array_constructor (gfc_expr **result)
|
||||||
/* Try to match an optional "type-spec ::" */
|
/* Try to match an optional "type-spec ::" */
|
||||||
gfc_clear_ts (&ts);
|
gfc_clear_ts (&ts);
|
||||||
gfc_new_undo_checkpoint (changed_syms);
|
gfc_new_undo_checkpoint (changed_syms);
|
||||||
if (gfc_match_decl_type_spec (&ts, 0) == MATCH_YES)
|
if (gfc_match_type_spec (&ts) == MATCH_YES)
|
||||||
{
|
{
|
||||||
seen_ts = (gfc_match (" ::") == MATCH_YES);
|
seen_ts = (gfc_match (" ::") == MATCH_YES);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1937,8 +1937,8 @@ match_derived_type_spec (gfc_typespec *ts)
|
||||||
the implicit_flag is not needed, so it was removed. Derived types are
|
the implicit_flag is not needed, so it was removed. Derived types are
|
||||||
identified by their name alone. */
|
identified by their name alone. */
|
||||||
|
|
||||||
static match
|
match
|
||||||
match_type_spec (gfc_typespec *ts)
|
gfc_match_type_spec (gfc_typespec *ts)
|
||||||
{
|
{
|
||||||
match m;
|
match m;
|
||||||
locus old_locus;
|
locus old_locus;
|
||||||
|
|
@ -3426,7 +3426,7 @@ gfc_match_allocate (void)
|
||||||
|
|
||||||
/* Match an optional type-spec. */
|
/* Match an optional type-spec. */
|
||||||
old_locus = gfc_current_locus;
|
old_locus = gfc_current_locus;
|
||||||
m = match_type_spec (&ts);
|
m = gfc_match_type_spec (&ts);
|
||||||
if (m == MATCH_ERROR)
|
if (m == MATCH_ERROR)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
else if (m == MATCH_NO)
|
else if (m == MATCH_NO)
|
||||||
|
|
@ -5502,7 +5502,7 @@ gfc_match_type_is (void)
|
||||||
c = gfc_get_case ();
|
c = gfc_get_case ();
|
||||||
c->where = gfc_current_locus;
|
c->where = gfc_current_locus;
|
||||||
|
|
||||||
if (match_type_spec (&c->ts) == MATCH_ERROR)
|
if (gfc_match_type_spec (&c->ts) == MATCH_ERROR)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
if (gfc_match_char (')') != MATCH_YES)
|
if (gfc_match_char (')') != MATCH_YES)
|
||||||
|
|
|
||||||
|
|
@ -59,6 +59,8 @@ match gfc_match_char (char);
|
||||||
match gfc_match (const char *, ...);
|
match gfc_match (const char *, ...);
|
||||||
match gfc_match_iterator (gfc_iterator *, int);
|
match gfc_match_iterator (gfc_iterator *, int);
|
||||||
match gfc_match_parens (void);
|
match gfc_match_parens (void);
|
||||||
|
match gfc_match_type_spec (gfc_typespec *);
|
||||||
|
|
||||||
|
|
||||||
/* Statement matchers. */
|
/* Statement matchers. */
|
||||||
match gfc_match_program (void);
|
match gfc_match_program (void);
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,10 @@
|
||||||
|
2013-06-07 Tobias Burnus <burnus@net-b.de>
|
||||||
|
|
||||||
|
PR fortran/57549
|
||||||
|
* gfortran.dg/array_constructor_48.f90: New.
|
||||||
|
* gfortran.dg/array_constructor_type_14.f03: Correct test case.
|
||||||
|
* gfortran.dg/array_constructor_type_15.f03: Ditto.
|
||||||
|
|
||||||
2013-06-07 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
2013-06-07 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
|
||||||
|
|
||||||
PR target/56315
|
PR target/56315
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
! { dg-do compile }
|
||||||
|
!
|
||||||
|
! PR fortran/57549
|
||||||
|
!
|
||||||
|
! Contributed by Vladimir Fuka
|
||||||
|
!
|
||||||
|
type t
|
||||||
|
end type
|
||||||
|
type(t),allocatable :: a(:)
|
||||||
|
a = [t::t()]
|
||||||
|
print *, [ integer :: ]
|
||||||
|
end
|
||||||
|
|
||||||
|
subroutine invalid()
|
||||||
|
print *, [ type(integer) :: ] ! { dg-error "Syntax error in array constructor" }
|
||||||
|
print *, [ type(tt) :: ] ! { dg-error "Syntax error in array constructor" }
|
||||||
|
end subroutine invalid
|
||||||
|
|
@ -16,7 +16,7 @@ PROGRAM test
|
||||||
|
|
||||||
TYPE(foo), DIMENSION(2) :: arr
|
TYPE(foo), DIMENSION(2) :: arr
|
||||||
|
|
||||||
arr = (/ TYPE(foo) :: x, foo(0, 1.) /)
|
arr = (/ foo :: x, foo(0, 1.) /)
|
||||||
IF (arr(1)%i /= 42 .OR. arr(1)%x /= 42. .OR. &
|
IF (arr(1)%i /= 42 .OR. arr(1)%x /= 42. .OR. &
|
||||||
arr(2)%i /= 0 .OR. arr(2)%x /= 1.) THEN
|
arr(2)%i /= 0 .OR. arr(2)%x /= 1.) THEN
|
||||||
CALL abort()
|
CALL abort()
|
||||||
|
|
|
||||||
|
|
@ -18,5 +18,5 @@ PROGRAM test
|
||||||
|
|
||||||
TYPE(foo), PARAMETER :: x = foo(42, 42.)
|
TYPE(foo), PARAMETER :: x = foo(42, 42.)
|
||||||
|
|
||||||
WRITE (*,*) (/ TYPE(foo) :: x, foo(0, 1.), bar(.TRUE.) /) ! { dg-error "convert TYPE" }
|
WRITE (*,*) (/ foo :: x, foo(0, 1.), bar(.TRUE.) /) ! { dg-error "convert TYPE" }
|
||||||
END PROGRAM test
|
END PROGRAM test
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue