+2007-08-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/33066
+ * decl.c (gfc_get_type_attr_spec): Fix whitespace.
+ (gfc_match_derived_decl): Fix logic.
+
2007-08-14 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/33073
if (gfc_add_access (attr, ACCESS_PUBLIC, NULL, NULL) == FAILURE)
return MATCH_ERROR;
}
- else if(gfc_match(" , bind ( c )") == MATCH_YES)
+ else if (gfc_match(" , bind ( c )") == MATCH_YES)
{
/* If the type is defined to be bind(c) it then needs to make
sure that all fields are interoperable. This will
gfc_symbol *sym;
match m;
match is_type_attr_spec = MATCH_NO;
+ bool seen_attr = false;
if (gfc_current_state () == COMP_DERIVED)
return MATCH_NO;
is_type_attr_spec = gfc_get_type_attr_spec (&attr);
if (is_type_attr_spec == MATCH_ERROR)
return MATCH_ERROR;
+ if (is_type_attr_spec == MATCH_YES)
+ seen_attr = true;
} while (is_type_attr_spec == MATCH_YES);
- if (gfc_match (" ::") != MATCH_YES && attr.access != ACCESS_UNKNOWN)
+ if (gfc_match (" ::") != MATCH_YES && seen_attr)
{
gfc_error ("Expected :: in TYPE definition at %C");
return MATCH_ERROR;
+2007-08-15 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR fortran/33066
+ * gfortran.dg/use_8.f90: New test.
+ * gfortran.dg/c_loc_tests_2.f03: Fix code.
+
2007-08-14 Paolo Carlini <pcarlini@suse.de>
PR c++/27211
end subroutine test1
subroutine test2() bind(c)
- type, bind(c) f90type
+ type, bind(c) :: f90type
integer(c_int) :: i
real(c_double) :: x
end type f90type
--- /dev/null
+! { dg-do compile }
+module a
+
+ type, private, bind(C) b ! { dg-error "Expected :: in TYPE definition" }
+ integer i
+ end type b ! { dg-error "Expecting END MODULE statement" }
+
+ type, public c ! { dg-error "Expected :: in TYPE definition" }
+ integer j
+ end type c ! { dg-error "Expecting END MODULE statement" }
+
+ type, private d ! { dg-error "Expected :: in TYPE definition" }
+ integer k
+ end type b ! { dg-error "Expecting END MODULE statement" }
+
+ type, bind(C), public e ! { dg-error "Expected :: in TYPE definition" }
+ integer l
+ end type e ! { dg-error "Expecting END MODULE statement" }
+
+ type, bind(C) f ! { dg-error "Expected :: in TYPE definition" }
+ integer m
+ end type f ! { dg-error "Expecting END MODULE statement" }
+
+end module a