This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/85088] improve diagnostic for bad INTENT declaration ('Invalid character in name at')


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 (&current_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;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]