aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorJanus Weil <janus@gcc.gnu.org>2016-11-08 23:07:21 +0100
committerJanus Weil <janus@gcc.gnu.org>2016-11-08 23:07:21 +0100
commit103c4f759ab75305a7cb7927af6b35b1f5da5f06 (patch)
treebca188b5b0956cce33dabe41bbc1bc121c18c073 /gcc/fortran/resolve.c
parentfe7913f6887eaa6f5cdb150bd5315f8464d06beb (diff)
downloadgcc-103c4f759ab75305a7cb7927af6b35b1f5da5f06.zip
gcc-103c4f759ab75305a7cb7927af6b35b1f5da5f06.tar.gz
gcc-103c4f759ab75305a7cb7927af6b35b1f5da5f06.tar.bz2
re PR fortran/68440 ([OOP] ICE on declaring class variable with wrong attribute)
2016-11-08 Janus Weil <janus@gcc.gnu.org> PR fortran/68440 * expr.c (check_alloc_comp_init): Loosen an assert. * resolve.c (resolve_fl_parameter): Reject class parameters. 2016-11-08 Janus Weil <janus@gcc.gnu.org> PR fortran/68440 * gfortran.dg/class_58.f90: New test. From-SVN: r241979
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index 3a4dd1f..f4d346e 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -14001,6 +14001,15 @@ resolve_fl_parameter (gfc_symbol *sym)
&sym->value->where);
return false;
}
+
+ /* F03:C509,C514. */
+ if (sym->ts.type == BT_CLASS)
+ {
+ gfc_error ("CLASS variable %qs at %L cannot have the PARAMETER attribute",
+ sym->name, &sym->declared_at);
+ return false;
+ }
+
return true;
}