diff options
author | Janus Weil <janus@gcc.gnu.org> | 2016-12-03 19:48:48 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2016-12-03 19:48:48 +0100 |
commit | 4ceda20498ec82d0fd24a2ab1e56c6c1e38b0174 (patch) | |
tree | 82c3f00c21994444b743b447187631ac06291467 /gcc/fortran | |
parent | 20fee4a901c0cf097df1f1ba00e226f1eb8e973c (diff) | |
download | gcc-4ceda20498ec82d0fd24a2ab1e56c6c1e38b0174.zip gcc-4ceda20498ec82d0fd24a2ab1e56c6c1e38b0174.tar.gz gcc-4ceda20498ec82d0fd24a2ab1e56c6c1e38b0174.tar.bz2 |
re PR fortran/43207 ([OOP] invalid (pointer) assignment to and from abstract non-polymorphic expressions)
2016-12-03 Janus Weil <janus@gcc.gnu.org>
PR fortran/43207
* primary.c (gfc_match_varspec): Reject nonpolymorphic references to
abstract types.
2016-12-03 Janus Weil <janus@gcc.gnu.org>
PR fortran/43207
* gfortran.dg/abstract_type_9.f90: New test case.
From-SVN: r243224
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/primary.c | 10 |
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index eaae696..3489bc4 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,11 @@ 2016-12-03 Janus Weil <janus@gcc.gnu.org> + PR fortran/43207 + * primary.c (gfc_match_varspec): Reject nonpolymorphic references to + abstract types. + +2016-12-03 Janus Weil <janus@gcc.gnu.org> + PR fortran/42188 * primary.c (gfc_match_rvalue): Add a new check that gives better error messages. diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 2cdc9a4..f13b0f0 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -2222,7 +2222,15 @@ check_substring: } } - /* F2008, C727. */ + /* F08:C611. */ + if (primary->ts.type == BT_DERIVED && primary->ref + && primary->ts.u.derived && primary->ts.u.derived->attr.abstract) + { + gfc_error ("Nonpolymorphic reference to abstract type at %C"); + return MATCH_ERROR; + } + + /* F08:C727. */ if (primary->expr_type == EXPR_PPC && gfc_is_coindexed (primary)) { gfc_error ("Coindexed procedure-pointer component at %C"); |