public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Harald Anlauf <anlauf@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-4720] Fortran: do not restrict PDT KIND and LEN type parameters to default integer Date: Tue, 26 Oct 2021 18:55:10 +0000 (GMT) [thread overview] Message-ID: <20211026185510.7B2673858D39@sourceware.org> (raw) https://gcc.gnu.org/g:cfcb27cfcb1d32b8cf7bc463cc1fc5cacae8d199 commit r12-4720-gcfcb27cfcb1d32b8cf7bc463cc1fc5cacae8d199 Author: Harald Anlauf <anlauf@gmx.de> Date: Tue Oct 26 20:54:41 2021 +0200 Fortran: do not restrict PDT KIND and LEN type parameters to default integer gcc/fortran/ChangeLog: PR fortran/102917 * decl.c (match_attr_spec): Remove invalid integer kind checks on KIND and LEN attributes of PDTs. gcc/testsuite/ChangeLog: PR fortran/102917 * gfortran.dg/pdt_4.f03: Adjust testcase. Diff: --- gcc/fortran/decl.c | 16 ---------------- gcc/testsuite/gfortran.dg/pdt_4.f03 | 4 ++-- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 6043e100fbb..ce61e53eb7b 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -5592,14 +5592,6 @@ match_attr_spec (void) m = MATCH_ERROR; goto cleanup; } - if (current_ts.kind != gfc_default_integer_kind) - { - gfc_error ("Component with KIND attribute at %C must be " - "default integer kind (%d)", - gfc_default_integer_kind); - m = MATCH_ERROR; - goto cleanup; - } } else if (d == DECL_LEN) { @@ -5619,14 +5611,6 @@ match_attr_spec (void) m = MATCH_ERROR; goto cleanup; } - if (current_ts.kind != gfc_default_integer_kind) - { - gfc_error ("Component with LEN attribute at %C must be " - "default integer kind (%d)", - gfc_default_integer_kind); - m = MATCH_ERROR; - goto cleanup; - } } else { diff --git a/gcc/testsuite/gfortran.dg/pdt_4.f03 b/gcc/testsuite/gfortran.dg/pdt_4.f03 index c1af65a5248..37412e4ca82 100644 --- a/gcc/testsuite/gfortran.dg/pdt_4.f03 +++ b/gcc/testsuite/gfortran.dg/pdt_4.f03 @@ -28,9 +28,9 @@ end module type :: bad_pdt (a,b, c, d) ! { dg-error "does not have a component" } real, kind :: a ! { dg-error "must be INTEGER" } - INTEGER(8), kind :: b ! { dg-error "be default integer kind" } + INTEGER(8), kind :: b real, LEN :: c ! { dg-error "must be INTEGER" } - INTEGER(8), LEN :: d ! { dg-error "be default integer kind" } + INTEGER(8), LEN :: d end type type :: mytype (a,b)
reply other threads:[~2021-10-26 18:55 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20211026185510.7B2673858D39@sourceware.org \ --to=anlauf@gcc.gnu.org \ --cc=gcc-cvs@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: linkBe 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).