diff options
author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-23 19:37:40 +0000 |
---|---|---|
committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-07-23 19:37:40 +0000 |
commit | 10ada81fea4490f94ba2eb5923bf5baa367a38bd (patch) | |
tree | 437dca120093cc7b1f6debf6f6b31779526c7192 /gcc/fortran/decl.c | |
parent | 95a236de8aa10bf009e9368dfd28f95a980e5570 (diff) | |
parent | 3bd7a983695352a99f7dd597725eb5b839d4b4cf (diff) | |
download | gcc-ifunc.tar.gz |
Merged with trunk at revision 162480.ifunc
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ifunc@162483 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r-- | gcc/fortran/decl.c | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c index 07c3acb9467..9515676acc9 100644 --- a/gcc/fortran/decl.c +++ b/gcc/fortran/decl.c @@ -1155,13 +1155,10 @@ build_sym (const char *name, gfc_charlen *cl, sym->attr.implied_index = 0; - if (sym->ts.type == BT_CLASS) - { - sym->attr.class_ok = (sym->attr.dummy - || sym->attr.pointer - || sym->attr.allocatable) ? 1 : 0; - gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false); - } + if (sym->ts.type == BT_CLASS + && (sym->attr.class_ok = sym->attr.dummy || sym->attr.pointer + || sym->attr.allocatable)) + gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false); return SUCCESS; } @@ -5874,7 +5871,7 @@ attr_decl1 (void) /* Update symbol table. DIMENSION attribute is set in gfc_set_array_spec(). For CLASS variables, this must be applied to the first component, or '$data' field. */ - if (sym->ts.type == BT_CLASS) + if (sym->ts.type == BT_CLASS && sym->ts.u.derived->attr.is_class) { if (gfc_copy_attr (&CLASS_DATA (sym)->attr, ¤t_attr,&var_locus) == FAILURE) @@ -5882,8 +5879,6 @@ attr_decl1 (void) m = MATCH_ERROR; goto cleanup; } - sym->attr.class_ok = (sym->attr.class_ok || current_attr.allocatable - || current_attr.pointer); } else { @@ -5894,6 +5889,11 @@ attr_decl1 (void) goto cleanup; } } + + if (sym->ts.type == BT_CLASS && !sym->attr.class_ok + && (sym->attr.class_ok = sym->attr.class_ok || current_attr.allocatable + || current_attr.pointer)) + gfc_build_class_symbol (&sym->ts, &sym->attr, &sym->as, false); if (gfc_set_array_spec (sym, as, &var_locus) == FAILURE) { @@ -7697,8 +7697,8 @@ match_procedure_in_type (void) } /* Construct the data structure. */ + memset (&tb, 0, sizeof (tb)); tb.where = gfc_current_locus; - tb.is_generic = 0; /* Match binding attributes. */ m = match_binding_attributes (&tb, false, false); @@ -7856,6 +7856,9 @@ gfc_match_generic (void) ns = block->f2k_derived; gcc_assert (block && ns); + memset (&tbattr, 0, sizeof (tbattr)); + tbattr.where = gfc_current_locus; + /* See if we get an access-specifier. */ m = match_binding_attributes (&tbattr, true, false); if (m == MATCH_ERROR) |