+2008-09-05 Daniel Kraft <d@domob.eu>
+
+ PR fortran/36746
+ * primary.c (gfc_match_rvalue): Removed logic to handle implicit
+ typing to a derived-type if a component reference is found.
+ (gfc_match_varspec): Moved it here.
+
2008-09-04 Richard Guenther <rguenther@suse.de>
* trans-array.c (gfc_conv_array_parameter): Use correct types
if (equiv_flag)
return MATCH_YES;
+ if (sym->ts.type == BT_UNKNOWN && gfc_peek_ascii_char () == '%'
+ && gfc_get_default_type (sym, sym->ns)->type == BT_DERIVED)
+ gfc_set_default_type (sym, 0, sym->ns);
+
if (sym->ts.type != BT_DERIVED || gfc_match_char ('%') != MATCH_YES)
goto check_substring;
{
case FL_VARIABLE:
variable:
- if (sym->ts.type == BT_UNKNOWN && gfc_peek_ascii_char () == '%'
- && gfc_get_default_type (sym, sym->ns)->type == BT_DERIVED)
- gfc_set_default_type (sym, 0, sym->ns);
-
e = gfc_get_expr ();
e->expr_type = EXPR_VARIABLE;
+2008-09-05 Daniel Kraft <d@domob.eu>
+
+ PR fortran/36746
+ * gfortran.dg/implicit_derived_type_1.f90: New test.
+ * gfortran.dg/used_before_typed_5.f90: New test.
+
2008-09-04 Jan Hubicka <jh@suse.cz>
* gcc.target/i386/cold-attribute-1.c: Update testcase.
--- /dev/null
+! { dg-do compile }
+
+! PR fortran/36746
+! Check that parsing of component references for symbols with IMPLICIT
+! derived-type works.
+
+! Reduced test from the PR.
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+module m
+ type t
+ integer :: i
+ end type t
+contains
+ subroutine s(x)
+ implicit type(t)(x)
+ dimension x(:)
+ print *, x(1)%i
+ end subroutine s
+end module m
--- /dev/null
+! { dg-do compile }
+! { dg-options "-pedantic -std=f95" }
+
+! Check that DIMENSION/POINTER/ALLOCATABLE/INTENT statements *do* allow
+! symbols to be typed later.
+
+SUBROUTINE test (a)
+ IMPLICIT REAL (a-z)
+
+ ! Those should *not* IMPLICIT-type the symbols:
+ INTENT(IN) :: a
+ DIMENSION :: b(:)
+ POINTER :: c
+ ALLOCATABLE :: b
+
+ ! So this is ok:
+ INTEGER :: a, b, c
+
+END SUBROUTINE test