public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/93787] Rejects non-ambigous specific in generic –
Date: Mon, 15 Feb 2021 11:30:59 +0000	[thread overview]
Message-ID: <bug-93787-4-thIEAG3vNo@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-93787-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93787

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> ---
The problem is in count_types_test:

For 'type(*),dimension(..)', compare_type_rank_if accepts a scalar integer
For 'type(*),dimension(*)', it does not.

As 'dimension(..)' accepts scalars, the symmetry is broken.
* For count_types_test f1=(a,async), f2=(a,len,async), the check
   if (ac1 > ac2)
  is false as  ac1 < ac2
* For count_types_test f1=(a,len,async), f2=(a,async), counting
   for f1's: 'len': ac1 = 2 ('len', 'async' – as 'a' as different rank != 0)
  That's fine but now:
    counting all type-rank-compatibles in f2 finds '(a,async)'
  again 2 → 'if (ac1 > ac2)'

(Looking through the checks, I wonder whether there is an ambiguity issue with
 dimension(*) vs. dimension(1,*) vs. dimension(1,1,*)
as one can pass to all of them any array rank, including rank=0 (for array
element), but I have no checked whether other checks catch this nor what the
spec says.)


In this case, a simple count of all nonoptional arguments would solve it, but I
wonder whether there are some gotchas when playing more with dimension(..) (and
possibly type(*) or NO_ARG_CHECK).

      parent reply	other threads:[~2021-02-15 11:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-93787-4@http.gcc.gnu.org/bugzilla/>
2021-02-14 13:47 ` dominiq at lps dot ens.fr
2021-02-15 11:30 ` burnus at gcc dot gnu.org [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-93787-4-thIEAG3vNo@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).