This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/52325] unclear error: Unclassifiable statement
- From: "burnus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 21 Feb 2012 11:05:11 +0000
- Subject: [Bug fortran/52325] unclear error: Unclassifiable statement
- Auto-submitted: auto-generated
- References: <bug-52325-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52325
Tobias Burnus <burnus at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
CC| |burnus at gcc dot gnu.org
--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2012-02-21 11:05:11 UTC ---
Untested patch:
--- primary.c (revision 184431)
+++ primary.c (working copy)
@@ -1910,6 +1910,19 @@ gfc_match_varspec (gfc_expr *primary, int equiv_fl
&& gfc_get_default_type (sym->name, sym->ns)->type == BT_DERIVED)
gfc_set_default_type (sym, 0, sym->ns);
+ if (sym->ts.type == BT_UNKNOWN && gfc_match_char ('%') == MATCH_YES)
+ {
+ gfc_error ("Symbol %s at %C has no IMPLICIT type", sym->name);
+ return MATCH_ERROR;
+ }
+ else if ((sym->ts.type != BT_DERIVED && sym->ts.type != BT_CLASS)
+ && gfc_match_char ('%') == MATCH_YES)
+ {
+ gfc_error ("Unexpected %% for nonderived type variable %s at %C",
+ sym->name);
+ return MATCH_ERROR;
+ }
+
if ((sym->ts.type != BT_DERIVED && sym->ts.type != BT_CLASS)
|| gfc_match_char ('%') != MATCH_YES)
goto check_substring;