re PR fortran/52652 (call to gfc_match_asynchronous for allocatable at parse.c line...
authorPaul Thomas <pault@gcc.gnu.org>
Wed, 28 Mar 2012 20:45:16 +0000 (20:45 +0000)
committerPaul Thomas <pault@gcc.gnu.org>
Wed, 28 Mar 2012 20:45:16 +0000 (20:45 +0000)
2012-03-28  Paul Thomas  <pault@gcc.gnu.org>
Tobias Burnus  <burnus@gcc.gnu.org>

PR fortran/52652
* match.c (gfc_match_allocate, gfc_match_deallocate): Change
"not.. or" to "neither.. nor".
* parse.c (decode_specification_statement): Correct error in
chpice of matching function for "allocatable".

2012-03-28  Paul Thomas  <pault@gcc.gnu.org>
Tobias Burnus  <burnus@gcc.gnu.org>

PR fortran/52652
* gfortran.dg/allocate_class_1.f90 : Change error test.
* gfortran.dg/allocate_with_typespec_4.f90 : Change error test.
* gfortran.dg/allocate_alloc_opt_1.f90 : Change error test.
* gfortran.dg/deallocate_alloc_opt_1.f90 : Change error test.

Co-Authored-By: Tobias Burnus <burnus@gcc.gnu.org>
From-SVN: r185924

gcc/fortran/ChangeLog
gcc/fortran/match.c
gcc/fortran/parse.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/allocate_alloc_opt_1.f90
gcc/testsuite/gfortran.dg/allocate_class_1.f90
gcc/testsuite/gfortran.dg/allocate_with_typespec_4.f90
gcc/testsuite/gfortran.dg/deallocate_alloc_opt_1.f90

index db6f87d20715688874464ee36b0ad2f424639566..4a79df8d1eff22077e91c1fb3ae37c961638e1fe 100644 (file)
@@ -1,3 +1,12 @@
+2012-03-28  Paul Thomas  <pault@gcc.gnu.org>
+       Tobias Burnus  <burnus@gcc.gnu.org>
+
+       PR fortran/52652
+       * match.c (gfc_match_allocate, gfc_match_deallocate): Change
+       "not.. or" to "neither.. nor".
+       * parse.c (decode_specification_statement): Correct error in
+       chpice of matching function for "allocatable". 
+
 2012-03-23  Janne Blomqvist  <jb@gcc.gnu.org>
 
        * gfortran.h (GFC_MAX_LINE): Remove unused macro.
index 14381608c907d52e6eabb89384b4202aeb16516c..15edfc36db1eff20d4b19f073cf389bcf8c4810f 100644 (file)
@@ -3572,8 +3572,8 @@ gfc_match_allocate (void)
                || sym->ns->proc_name->attr.proc_pointer);
       if (b1 && b2 && !b3)
        {
-         gfc_error ("Allocate-object at %L is not a nonprocedure pointer "
-                    "or an allocatable variable", &tail->expr->where);
+         gfc_error ("Allocate-object at %L is neither a nonprocedure pointer "
+                    "nor an allocatable variable", &tail->expr->where);
          goto cleanup;
        }
 
@@ -3904,7 +3904,7 @@ gfc_match_deallocate (void)
       if (b1 && b2)
        {
          gfc_error ("Allocate-object at %C is not a nonprocedure pointer "
-                    "or an allocatable variable");
+                    "nor an allocatable variable");
          goto cleanup;
        }
 
index 317fb845479ee7b2deb68c050fbf34f98df56c8c..4e7f691e6309afd390059e2c282f5df401e99b31 100644 (file)
@@ -161,7 +161,7 @@ decode_specification_statement (void)
     case 'a':
       match ("abstract% interface", gfc_match_abstract_interface,
             ST_INTERFACE);
-      match ("allocatable", gfc_match_asynchronous, ST_ATTR_DECL);
+      match ("allocatable", gfc_match_allocatable, ST_ATTR_DECL);
       match ("asynchronous", gfc_match_asynchronous, ST_ATTR_DECL);
       break;
 
index b965221b1b17baf4af38c4ddafce7fb89a61ea28..945e50795db40cf8389751ff1d7590b4e7874e05 100644 (file)
@@ -1,3 +1,12 @@
+2012-03-28  Paul Thomas  <pault@gcc.gnu.org>
+       Tobias Burnus  <burnus@gcc.gnu.org>
+
+       PR fortran/52652
+       * gfortran.dg/allocate_class_1.f90 : Change error test.
+       * gfortran.dg/allocate_with_typespec_4.f90 : Change error test.
+       * gfortran.dg/allocate_alloc_opt_1.f90 : Change error test.
+       * gfortran.dg/deallocate_alloc_opt_1.f90 : Change error test.
+
 2012-03-28  Jakub Jelinek  <jakub@redhat.com>
 
        PR middle-end/52691
index 52e0262f4e651d8462f2bdf432add83af0c197bc..3a05e8cff02fe9c7a7f3e4229fbce96f51410f18 100644 (file)
@@ -24,7 +24,7 @@ program a
   allocate(i(2), errmsg=err) ! { dg-warning "useless without a STAT" }
   allocate(i(2), stat=j, errmsg=x) ! { dg-error "must be a scalar CHARACTER" }
 
-  allocate(err) ! { dg-error "nonprocedure pointer or an allocatable" }
+  allocate(err) ! { dg-error "neither a nonprocedure pointer nor an allocatable" }
 
   allocate(error(2),stat=j,errmsg=error(1)) ! { dg-error "shall not be ALLOCATEd within" }
   allocate(i(2), stat = i(1))  ! { dg-error "shall not be ALLOCATEd within" }
index 1dea056b74f2d9b1e3beb5f0ebf69bcdd38d9d77..9a2a5cb2538c95da41307a841f80a94f84aacebf 100644 (file)
@@ -7,5 +7,5 @@
  type :: t0
  end type
  class(t0) :: x  ! { dg-error "must be dummy, allocatable or pointer" }
- allocate(x)     ! { dg-error "is not a nonprocedure pointer or an allocatable variable" }
+ allocate(x)     ! { dg-error "is neither a nonprocedure pointer nor an allocatable variable" }
  end
index 327f28dcdc9934dc5c0e4dacc3a8b423743436a4..54ed109fc24c45309f01a261cf56c0afaf0f259d 100644 (file)
@@ -21,7 +21,7 @@ subroutine not_an_f03_intrinsic
    allocate(real*8 :: y(1))       ! { dg-error "Invalid type-spec at" }
    allocate(real*4 :: x8)         ! { dg-error "Invalid type-spec at" }
    allocate(real*4 :: y8(1))      ! { dg-error "Invalid type-spec at" }
-   allocate(double complex :: d1) ! { dg-error "not a nonprocedure pointer or an allocatable" }
+   allocate(double complex :: d1) ! { dg-error "neither a nonprocedure pointer nor an allocatable" }
    allocate(real_type :: b)
    allocate(real_type :: c(1))
 
index 5c00741f61c8bca510a5ac201cadd2c760ed74ec..969ce257efe96e15d27203bb1dbe240750a6520a 100644 (file)
@@ -24,7 +24,7 @@ program a
   deallocate(i, errmsg=err) ! { dg-warning "useless without a STAT" }
   deallocate(i, stat=j, errmsg=x) ! { dg-error "must be a scalar CHARACTER" }
 
-  deallocate(err) ! { dg-error "nonprocedure pointer or an allocatable" }
+  deallocate(err) ! { dg-error "nonprocedure pointer nor an allocatable" }
 
   deallocate(error,stat=j,errmsg=error(1)) ! { dg-error "shall not be DEALLOCATEd within" }
   deallocate(i, stat = i(1))  ! { dg-error "shall not be DEALLOCATEd within" }