OSDN Git Service

2010-03-14 Tobias Burnus <burnus@net-b.de>
[pf3gnuchains/gcc-fork.git] / gcc / fortran / resolve.c
index dfa2232..a8b58d1 100644 (file)
@@ -945,13 +945,12 @@ resolve_structure_cons (gfc_expr *expr)
 
       /* F2003, C1272 (3).  */
       if (gfc_pure (NULL) && cons->expr->expr_type == EXPR_VARIABLE
-         && (gfc_impure_variable (cons->expr->symtree->n.sym)
-             || gfc_is_coindexed (cons->expr)))
+         && gfc_impure_variable (cons->expr->symtree->n.sym))
        {
          t = FAILURE;
-         gfc_error ("Invalid expression in the derived type constructor for "
-                    "pointer component '%s' at %L in PURE procedure",
-                    comp->name, &cons->expr->where);
+         gfc_error ("Invalid expression in the derived type constructor for pointer "
+                    "component '%s' at %L in PURE procedure", comp->name,
+                    &cons->expr->where);
        }
     }
 
@@ -5299,12 +5298,6 @@ resolve_compcall (gfc_expr* e, bool fcn, bool class_members)
   e->ts = target->n.sym->ts;
   e->expr_type = EXPR_FUNCTION;
 
-<<<<<<< HEAD
-  /* Resolution is not necessary if this is a class subroutine; this
-     function only has to identify the specific proc. Resolution of
-     the call will be done next in resolve_typebound_call.  */
-  return gfc_resolve_expr (e);
-=======
   /* Resolution is not necessary when constructing component calls
      for class members, since this must only be done for the
      declared type, which is done afterwards.  */
@@ -5457,7 +5450,6 @@ hash_value_expr (gfc_ref *class_ref, gfc_ref *new_ref, gfc_symtree *st)
   gfc_add_component_ref (hash_value, "$hash");
 
   return hash_value;
->>>>>>> 2010-03-12  Paul Thomas  <pault@gcc.gnu.org>
 }
 
 
@@ -5497,14 +5489,11 @@ get_declared_from_expr (gfc_ref **class_ref, gfc_ref **new_ref,
 /* Resolve a typebound function, or 'method'. First separate all
    the non-CLASS references by calling resolve_compcall directly.  */
 
-<<<<<<< HEAD
-=======
 /* Resolve a typebound function, or 'method'.  First separate all
    the non-CLASS references by calling resolve_compcall directly.
    Then treat the CLASS references by resolving for each of the class
    members in turn.  */
 
->>>>>>> 2010-03-12  Paul Thomas  <pault@gcc.gnu.org>
 static gfc_try
 resolve_typebound_function (gfc_expr* e)
 {
@@ -5519,28 +5508,17 @@ resolve_typebound_function (gfc_expr* e)
 
   st = e->symtree;
   if (st == NULL)
-<<<<<<< HEAD
-    return resolve_compcall (e, NULL);
-=======
     return resolve_compcall (e, true, false);
->>>>>>> 2010-03-12  Paul Thomas  <pault@gcc.gnu.org>
 
   /* Get the CLASS declared type.  */
   declared = get_declared_from_expr (&class_ref, &new_ref, e);
 
   /* Weed out cases of the ultimate component being a derived type.  */
   if ((class_ref && class_ref->u.c.component->ts.type == BT_DERIVED)
-<<<<<<< HEAD
-        || (!class_ref && st->n.sym->ts.type != BT_CLASS))
-    {
-      gfc_free_ref_list (new_ref);
-      return resolve_compcall (e, NULL);
-=======
        || (!class_ref && st->n.sym->ts.type != BT_CLASS))
     {
       gfc_free_ref_list (new_ref);
       return resolve_compcall (e, true, false);
->>>>>>> 2010-03-12  Paul Thomas  <pault@gcc.gnu.org>
     }
 
   c = gfc_find_component (declared, "$data", true, true);
@@ -5556,14 +5534,8 @@ resolve_typebound_function (gfc_expr* e)
   resolve_compcall (e, &name);
   ts = e->ts;
 
-<<<<<<< HEAD
-  /* Then convert the expression to a procedure pointer component call.  */
-  e->value.function.esym = NULL;
-  e->symtree = st;
-=======
   class_try = (resolve_compcall (e, true, false) == SUCCESS)
                 ? class_try : FAILURE;
->>>>>>> 2010-03-12  Paul Thomas  <pault@gcc.gnu.org>
 
   if (class_ref)  
     {
@@ -5592,16 +5564,10 @@ resolve_typebound_function (gfc_expr* e)
   return SUCCESS;
 }
 
-<<<<<<< HEAD
-/* Resolve a typebound subroutine, or 'method'. First separate all
-   the non-CLASS references by calling resolve_typebound_call
-   directly.  */
-=======
 /* Resolve a typebound subroutine, or 'method'.  First separate all
    the non-CLASS references by calling resolve_typebound_call directly.
    Then treat the CLASS references by resolving for each of the class
    members in turn.  */
->>>>>>> 2010-03-12  Paul Thomas  <pault@gcc.gnu.org>
 
 static gfc_try
 resolve_typebound_subroutine (gfc_code *code)
@@ -5617,22 +5583,14 @@ resolve_typebound_subroutine (gfc_code *code)
 
   st = code->expr1->symtree;
   if (st == NULL)
-<<<<<<< HEAD
-    return resolve_typebound_call (code, NULL);
-=======
     return resolve_typebound_call (code);
->>>>>>> 2010-03-12  Paul Thomas  <pault@gcc.gnu.org>
 
   /* Get the CLASS declared type.  */
   declared = get_declared_from_expr (&class_ref, &new_ref, code->expr1);
 
   /* Weed out cases of the ultimate component being a derived type.  */
   if ((class_ref && class_ref->u.c.component->ts.type == BT_DERIVED)
-<<<<<<< HEAD
-        || (!class_ref && st->n.sym->ts.type != BT_CLASS))
-=======
        || (!class_ref && st->n.sym->ts.type != BT_CLASS))
->>>>>>> 2010-03-12  Paul Thomas  <pault@gcc.gnu.org>
     {
       gfc_free_ref_list (new_ref);
       return resolve_typebound_call (code, NULL);
@@ -8349,25 +8307,7 @@ resolve_ordinary_assign (gfc_code *code, gfc_namespace *ns)
            && lhs->expr_type == EXPR_VARIABLE
            && lhs->ts.u.derived->attr.pointer_comp
            && rhs->expr_type == EXPR_VARIABLE
-           && (gfc_impure_variable (rhs->symtree->n.sym)
-               || gfc_is_coindexed (rhs)))
-       {
-         /* F2008, C1283.  */
-         if (gfc_is_coindexed (rhs))
-           gfc_error ("Coindexed expression at %L is assigned to "
-                       "a derived type variable with a POINTER "
-                       "component in a PURE procedure",
-                       &rhs->where);
-         else
-           gfc_error ("The impure variable at %L is assigned to "
-                       "a derived type variable with a POINTER "
-                       "component in a PURE procedure (12.6)",
-                       &rhs->where);
-         return rval;
-       }
-
-      /* Fortran 2008, C1283.  */
-      if (gfc_is_coindexed (lhs))
+           && gfc_impure_variable (rhs->symtree->n.sym))
        {
          gfc_error ("Assignment to coindexed variable at %L in a PURE "
                     "procedure", &rhs->where);