aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/interface.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2011-11-08 03:20:30 +0000
committerAldy Hernandez <aldyh@redhat.com>2011-11-08 03:20:30 +0000
commit47180e1668b0766d1e473fed8d9385c0e765285d (patch)
tree1eb48ad31d05a9ce117bedc17115de96dffa2f0b /gcc/fortran/interface.c
parent80b9b1c40004ddf7dd74248b642d489384f37ace (diff)
parenteb6a1d75b768b663579adeb2a50828cf679b6f12 (diff)
* Merge from mainline rev 181122.transactional-memory
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/transactional-memory@181148 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/interface.c')
-rw-r--r--gcc/fortran/interface.c28
1 files changed, 12 insertions, 16 deletions
diff --git a/gcc/fortran/interface.c b/gcc/fortran/interface.c
index 5308513b774..90d98c759dd 100644
--- a/gcc/fortran/interface.c
+++ b/gcc/fortran/interface.c
@@ -405,7 +405,7 @@ gfc_compare_derived_types (gfc_symbol *derived1, gfc_symbol *derived2)
return 1;
/* Compare type via the rules of the standard. Both types must have
- the SEQUENCE attribute to be equal. */
+ the SEQUENCE or BIND(C) attribute to be equal. */
if (strcmp (derived1->name, derived2->name))
return 0;
@@ -414,7 +414,8 @@ gfc_compare_derived_types (gfc_symbol *derived1, gfc_symbol *derived2)
|| derived2->component_access == ACCESS_PRIVATE)
return 0;
- if (derived1->attr.sequence == 0 || derived2->attr.sequence == 0)
+ if (!(derived1->attr.sequence && derived2->attr.sequence)
+ && !(derived1->attr.is_bind_c && derived2->attr.is_bind_c))
return 0;
dt1 = derived1->components;
@@ -3220,12 +3221,11 @@ build_compcall_for_operator (gfc_expr* e, gfc_actual_arglist* actual,
with the operator. This subroutine builds an actual argument list
corresponding to the operands, then searches for a compatible
interface. If one is found, the expression node is replaced with
- the appropriate function call.
- real_error is an additional output argument that specifies if FAILURE
- is because of some real error and not because no match was found. */
+ the appropriate function call. We use the 'match' enum to specify
+ whether a replacement has been made or not, or if an error occurred. */
-gfc_try
-gfc_extend_expr (gfc_expr *e, bool *real_error)
+match
+gfc_extend_expr (gfc_expr *e)
{
gfc_actual_arglist *actual;
gfc_symbol *sym;
@@ -3239,7 +3239,6 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
actual = gfc_get_actual_arglist ();
actual->expr = e->value.op.op1;
- *real_error = false;
gname = NULL;
if (e->value.op.op2 != NULL)
@@ -3343,16 +3342,16 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
result = gfc_resolve_expr (e);
if (result == FAILURE)
- *real_error = true;
+ return MATCH_ERROR;
- return result;
+ return MATCH_YES;
}
/* Don't use gfc_free_actual_arglist(). */
free (actual->next);
free (actual);
- return FAILURE;
+ return MATCH_NO;
}
/* Change the expression node to a function call. */
@@ -3365,12 +3364,9 @@ gfc_extend_expr (gfc_expr *e, bool *real_error)
e->user_operator = 1;
if (gfc_resolve_expr (e) == FAILURE)
- {
- *real_error = true;
- return FAILURE;
- }
+ return MATCH_ERROR;
- return SUCCESS;
+ return MATCH_YES;
}