From: Tobias Burnus <tobias@codesourcery.com>
To: Fritz Reese <fritzoreese@gmail.com>,
fortran <fortran@gcc.gnu.org>,
gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: PING -- [PATCH, fortran] PR 85982 -- ICE in resolve_component
Date: Thu, 2 Apr 2020 09:50:42 +0200 [thread overview]
Message-ID: <520bc574-7116-0a67-6985-7faade12dd66@codesourcery.com> (raw)
In-Reply-To: <CAE4aFAm5gGyyLjkp=Ne8ea5V4X2=g=OmtGcUPb03unMB2DT1NQ@mail.gmail.com>
In principle, I like the patch. However, I think one should
replace
gfc_error ("Attribute at %L is not allowed in a %s definition",
…, state_name
by something like:
bool is_type = gfc_current_state () == COMP_DERIVED;
gfc_error (is_type ? G_("Attribute at %L is not allowed in a TYPE definition")
: G_("Attribute at %L is not allowed in a STRUCTURE definition"),
…
Reason: (a) This makes translation simpler; e.g. 'structure' and 'type' have
different gender in several European languages. (Albeit in this case the
gender of 'definition' dominates in the cases I checked.)
(b) For TYPE, the string won't change such that the existing translations
still work – even if the update for STRUCTURE won't make it for the release.
Otherwise it looks good to me, including the test case in your follow-up email.
Cheers,
Tobias
On 4/1/20 7:19 PM, Fritz Reese via Fortran wrote:
> This simple patch was submitted some time ago (over 1 year), but got
> lost without review. I have lately rebased and tested, and the patch
> is still good. Is this OK to commit to trunk and for backport? I'd
> like to port as far back as 7.
>
> ---
> Fritz Reese
>
> gcc/ChangeLog:
> 2020-04-01 Fritz Reese <foreese@gcc.gnu.org>
>
> PR fortran/85982
> * fortran/decl.c (match_attr_spec): Lump COMP_STRUCTURE/COMP_MAP into
> attribute checking used by TYPE.
>
> gcc/testsuite/ChangeLog:
> 2020-04-01 Fritz Reese <foreese@gcc.gnu.org>
>
> PR fortran/85982
> * gfortran.dg/dec_structure_28.f90: New test.
-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander Walter
next prev parent reply other threads:[~2020-04-02 7:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-01 17:19 Fritz Reese
2020-04-01 18:00 ` Fritz Reese
2020-04-02 7:50 ` Tobias Burnus [this message]
2020-04-02 16:20 ` Fritz Reese
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=520bc574-7116-0a67-6985-7faade12dd66@codesourcery.com \
--to=tobias@codesourcery.com \
--cc=fortran@gcc.gnu.org \
--cc=fritzoreese@gmail.com \
--cc=gcc-patches@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).