This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/85088] improve diagnostic for bad INTENT declaration ('Invalid character in name at')
- From: "dominiq at lps dot ens.fr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Mar 2018 16:30:29 +0000
- Subject: [Bug fortran/85088] improve diagnostic for bad INTENT declaration ('Invalid character in name at')
- Auto-submitted: auto-generated
- References: <bug-85088-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85088
--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
It seems that there is some inconsistencies between
/* TODO: Call match_intent_spec from here. */
if (gfc_match (" ( in out )") == MATCH_YES)
d = DECL_INOUT;
else if (gfc_match (" ( in )") == MATCH_YES)
d = DECL_IN;
else if (gfc_match (" ( out )") == MATCH_YES)
d = DECL_OUT;
and
match
gfc_match_intent (void)
{
sym_intent intent;
/* This is not allowed within a BLOCK construct! */
if (gfc_current_state () == COMP_BLOCK)
{
gfc_error ("INTENT is not allowed inside of BLOCK at %C");
return MATCH_ERROR;
}
intent = match_intent_spec ();
if (intent == INTENT_UNKNOWN)
return MATCH_ERROR;
gfc_clear_attr (¤t_attr);
current_attr.intent = intent;
return attr_decl ();
}
and
static sym_intent
match_intent_spec (void)
{
if (gfc_match (" ( in out )") == MATCH_YES)
return INTENT_INOUT;
if (gfc_match (" ( in )") == MATCH_YES)
return INTENT_IN;
if (gfc_match (" ( out )") == MATCH_YES)
return INTENT_OUT;
gfc_error ("Bad INTENT specification at %C");
return INTENT_UNKNOWN;
}