aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2019-01-02 19:13:29 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2019-01-02 19:13:29 +0000
commitf8fdc8c99aed6d39cc29fcd18aa8fd46f7fe9ea3 (patch)
tree4008553e85f333b3fc2160510fc8fa140770d5f7 /gcc
parentaaf83eb753aaa28980c3ed0bee134fe79025699e (diff)
downloadgcc-f8fdc8c99aed6d39cc29fcd18aa8fd46f7fe9ea3.zip
gcc-f8fdc8c99aed6d39cc29fcd18aa8fd46f7fe9ea3.tar.gz
gcc-f8fdc8c99aed6d39cc29fcd18aa8fd46f7fe9ea3.tar.bz2
parse.c (decode_statement): Suppress "Unclassifiable statement" error if previous error messages were emittes.
2019-01-01 Steven G. Kargl <kargl@gcc.gnu.org> * parse.c (decode_statement): Suppress "Unclassifiable statement" error if previous error messages were emittes. 2019-01-01 Steven G. Kargl <kargl@gcc.gnu.org> * gfortran.dg/argument_checking_7.f90: Remove run-on error message. * gfortran.dg/dec_d_lines_3.f: Ditto. * gfortran.dg/dec_structure_24.f90: Ditto. * gfortran.dg/dec_structure_26.f90: Ditto. * gfortran.dg/dec_structure_27.f90: Ditto. * gfortran.dg/dec_type_print_3.f90: Ditto. * gfortran.dg/derived_name_1.f90: Ditto. * gfortran.dg/error_recovery_1.f90: Ditto. * gfortran.dg/gomp/pr29759.f90: Ditto. * gfortran.dg/pr36192.f90: Ditto. * gfortran.dg/pr56007.f90: Ditto. * gfortran.dg/pr56520.f90: Ditto. * gfortran.dg/pr78741.f90: Ditto. * gfortran.dg/print_fmt_2.f90: Ditto. * gfortran.dg/select_type_20.f90: Ditto. From-SVN: r267526
Diffstat (limited to 'gcc')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/parse.c12
-rw-r--r--gcc/testsuite/ChangeLog18
-rw-r--r--gcc/testsuite/gfortran.dg/argument_checking_7.f902
-rw-r--r--gcc/testsuite/gfortran.dg/dec_d_lines_3.f2
-rw-r--r--gcc/testsuite/gfortran.dg/dec_structure_24.f904
-rw-r--r--gcc/testsuite/gfortran.dg/dec_structure_26.f904
-rw-r--r--gcc/testsuite/gfortran.dg/dec_structure_27.f904
-rw-r--r--gcc/testsuite/gfortran.dg/dec_type_print_3.f901
-rw-r--r--gcc/testsuite/gfortran.dg/derived_name_1.f904
-rw-r--r--gcc/testsuite/gfortran.dg/error_recovery_1.f902
-rw-r--r--gcc/testsuite/gfortran.dg/gomp/pr29759.f908
-rw-r--r--gcc/testsuite/gfortran.dg/pr36192.f902
-rw-r--r--gcc/testsuite/gfortran.dg/pr56007.f902
-rw-r--r--gcc/testsuite/gfortran.dg/pr56520.f906
-rw-r--r--gcc/testsuite/gfortran.dg/pr78741.f902
-rw-r--r--gcc/testsuite/gfortran.dg/print_fmt_2.f902
-rw-r--r--gcc/testsuite/gfortran.dg/select_type_20.f9014
18 files changed, 54 insertions, 40 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 245772de..303892d 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2019-01-01 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * parse.c (decode_statement): Suppress "Unclassifiable statement"
+ error if previous error messages were emittes.
+
2019-01-01 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/82743
diff --git a/gcc/fortran/parse.c b/gcc/fortran/parse.c
index 399867b..6b33c57 100644
--- a/gcc/fortran/parse.c
+++ b/gcc/fortran/parse.c
@@ -587,10 +587,16 @@ decode_statement (void)
}
/* All else has failed, so give up. See if any of the matchers has
- stored an error message of some sort. */
-
+ stored an error message of some sort. Suppress the "Unclassifiable
+ statement" if a previous error message was emitted, e.g., by
+ gfc_error_now (). */
if (!gfc_error_check ())
- gfc_error_now ("Unclassifiable statement at %C");
+ {
+ int ecnt;
+ gfc_get_errors (NULL, &ecnt);
+ if (ecnt <= 0)
+ gfc_error_now ("Unclassifiable statement at %C");
+ }
reject_statement ();
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 23691cd..a5caf02 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,21 @@
+2019-01-02 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ * gfortran.dg/argument_checking_7.f90: Remove run-on error message.
+ * gfortran.dg/dec_d_lines_3.f: Ditto.
+ * gfortran.dg/dec_structure_24.f90: Ditto.
+ * gfortran.dg/dec_structure_26.f90: Ditto.
+ * gfortran.dg/dec_structure_27.f90: Ditto.
+ * gfortran.dg/dec_type_print_3.f90: Ditto.
+ * gfortran.dg/derived_name_1.f90: Ditto.
+ * gfortran.dg/error_recovery_1.f90: Ditto.
+ * gfortran.dg/gomp/pr29759.f90: Ditto.
+ * gfortran.dg/pr36192.f90: Ditto.
+ * gfortran.dg/pr56007.f90: Ditto.
+ * gfortran.dg/pr56520.f90: Ditto.
+ * gfortran.dg/pr78741.f90: Ditto.
+ * gfortran.dg/print_fmt_2.f90: Ditto.
+ * gfortran.dg/select_type_20.f90: Ditto.
+
2019-01-02 Marek Polacek <polacek@redhat.com>
PR c++/86875
diff --git a/gcc/testsuite/gfortran.dg/argument_checking_7.f90 b/gcc/testsuite/gfortran.dg/argument_checking_7.f90
index 0bf76cb..45fd51d 100644
--- a/gcc/testsuite/gfortran.dg/argument_checking_7.f90
+++ b/gcc/testsuite/gfortran.dg/argument_checking_7.f90
@@ -12,7 +12,7 @@ module cyclic
character(len(y)-1) ouch ! { dg-error "used before it is typed" }
integer i
do i = 1, len(ouch)
- ouch(i:i) = achar(ieor(iachar(x(i:i)),iachar(y(i:i)))) ! { dg-error "Unclassifiable statement" }
+ ouch(i:i) = achar(ieor(iachar(x(i:i)),iachar(y(i:i))))
end do
end function ouch
end module cyclic
diff --git a/gcc/testsuite/gfortran.dg/dec_d_lines_3.f b/gcc/testsuite/gfortran.dg/dec_d_lines_3.f
index 2df4341..1e96d75 100644
--- a/gcc/testsuite/gfortran.dg/dec_d_lines_3.f
+++ b/gcc/testsuite/gfortran.dg/dec_d_lines_3.f
@@ -9,6 +9,4 @@
include 'dec_d_lines_2.f'
! { dg-error "character in statement label" " " { target *-*-*} 6 }
-! { dg-error "Unclassifiable statement" " " { target *-*-*} 6 }
! { dg-error "character in statement label" " " { target *-*-*} 7 }
-! { dg-error "Unclassifiable statement" " " { target *-*-*} 7 }
diff --git a/gcc/testsuite/gfortran.dg/dec_structure_24.f90 b/gcc/testsuite/gfortran.dg/dec_structure_24.f90
index 02842b3..b4da5ee 100644
--- a/gcc/testsuite/gfortran.dg/dec_structure_24.f90
+++ b/gcc/testsuite/gfortran.dg/dec_structure_24.f90
@@ -12,10 +12,6 @@ include 'dec_structure_1.f90'
! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 19 }
! { dg-error "-fdec-structure" " " { target *-*-* } 21 }
! { dg-error "-fdec-structure" " " { target *-*-* } 22 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 25 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 26 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 27 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 28 }
! { dg-error "is not a variable" " " { target *-*-* } 30 }
! { dg-error "Bad character" " " { target *-*-* } 32 }
! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 34 }
diff --git a/gcc/testsuite/gfortran.dg/dec_structure_26.f90 b/gcc/testsuite/gfortran.dg/dec_structure_26.f90
index 7829103..b7c8aae 100644
--- a/gcc/testsuite/gfortran.dg/dec_structure_26.f90
+++ b/gcc/testsuite/gfortran.dg/dec_structure_26.f90
@@ -14,10 +14,6 @@ include 'dec_structure_1.f90'
! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 19 }
! { dg-error "-fdec-structure" " " { target *-*-* } 21 }
! { dg-error "-fdec-structure" " " { target *-*-* } 22 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 25 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 26 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 27 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 28 }
! { dg-error "is not a variable" " " { target *-*-* } 30 }
! { dg-error "Bad character" " " { target *-*-* } 32 }
! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 34 }
diff --git a/gcc/testsuite/gfortran.dg/dec_structure_27.f90 b/gcc/testsuite/gfortran.dg/dec_structure_27.f90
index 1257365..ed976fc 100644
--- a/gcc/testsuite/gfortran.dg/dec_structure_27.f90
+++ b/gcc/testsuite/gfortran.dg/dec_structure_27.f90
@@ -14,10 +14,6 @@ include 'dec_structure_1.f90'
! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 19 }
! { dg-error "-fdec-structure" " " { target *-*-* } 21 }
! { dg-error "-fdec-structure" " " { target *-*-* } 22 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 25 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 26 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 27 }
-! { dg-error "Unclassifiable statement" " " { target *-*-* } 28 }
! { dg-error "is not a variable" " " { target *-*-* } 30 }
! { dg-error "Bad character" " " { target *-*-* } 32 }
! { dg-error "Expecting END PROGRAM" " " { target *-*-* } 34 }
diff --git a/gcc/testsuite/gfortran.dg/dec_type_print_3.f90 b/gcc/testsuite/gfortran.dg/dec_type_print_3.f90
index f766bdf..e5b455e 100644
--- a/gcc/testsuite/gfortran.dg/dec_type_print_3.f90
+++ b/gcc/testsuite/gfortran.dg/dec_type_print_3.f90
@@ -15,7 +15,6 @@ include 'dec_type_print.f90'
! { dg-error "Invalid character in name" "" { target *-*-* } 56 }
! { dg-error "Invalid character in name" "" { target *-*-* } 57 }
! { dg-error "Invalid character in name" "" { target *-*-* } 58 }
-! { dg-error "Unclassifiable statement" "" { target *-*-* } 59 }
! { dg-error "conflicts with PROCEDURE" "" { target *-*-* } 60 }
! { dg-error "Cannot assign to a named constant" "" { target *-*-* } 80 }
diff --git a/gcc/testsuite/gfortran.dg/derived_name_1.f90 b/gcc/testsuite/gfortran.dg/derived_name_1.f90
index 9c6b177..32a76ed 100644
--- a/gcc/testsuite/gfortran.dg/derived_name_1.f90
+++ b/gcc/testsuite/gfortran.dg/derived_name_1.f90
@@ -7,9 +7,9 @@ type complex ! { dg-error "cannot be the same as an intrinsic type" }
type character ! { dg-error "cannot be the same as an intrinsic type" }
type logical ! { dg-error "cannot be the same as an intrinsic type" }
type complex ! { dg-error "cannot be the same as an intrinsic type" }
-type double precision ! { dg-error "Unclassifiable statement" }
+type double precision
type doubleprecision ! { dg-error "cannot be the same as an intrinsic type" }
-type double complex ! { dg-error "Unclassifiable statement" }
+type double complex
type doublecomplex ! { dg-error "cannot be the same as an intrinsic type" }
type x
diff --git a/gcc/testsuite/gfortran.dg/error_recovery_1.f90 b/gcc/testsuite/gfortran.dg/error_recovery_1.f90
index 8d4f65b..7f19ab5 100644
--- a/gcc/testsuite/gfortran.dg/error_recovery_1.f90
+++ b/gcc/testsuite/gfortran.dg/error_recovery_1.f90
@@ -10,6 +10,6 @@ module gfcbug29_import
end module gfcbug29_import
subroutine FOO
- X :: I ! { dg-error "Unclassifiable statement" }
+ X :: I
equivalence (I,I)
end
diff --git a/gcc/testsuite/gfortran.dg/gomp/pr29759.f90 b/gcc/testsuite/gfortran.dg/gomp/pr29759.f90
index b723eeb..39c59c5 100644
--- a/gcc/testsuite/gfortran.dg/gomp/pr29759.f90
+++ b/gcc/testsuite/gfortran.dg/gomp/pr29759.f90
@@ -22,21 +22,21 @@ PROGRAM test_omp
!$OMP PARALLEL & ! { dg-error "Unclassifiable OpenMP" }
-!$ NUM_THREADS(2) ! { dg-error "Unclassifiable|Invalid character" }
+!$ NUM_THREADS(2)
!$OMP END PARALLEL ! { dg-error "Unexpected" }
!$OMP PARALLEL & ! { dg-error "Unclassifiable OpenMP" }
-!$ & NUM_THREADS(2) ! { dg-error "Unclassifiable|Invalid character" }
+!$ & NUM_THREADS(2) ! { dg-error "Invalid character" }
!$OMP END PARALLEL ! { dg-error "Unexpected" }
!$OMP PARALLEL & ! { dg-error "Unclassifiable OpenMP" }
!
-!$ NUM_THREADS(2) ! { dg-error "Unclassifiable|Invalid character" }
+!$ NUM_THREADS(2)
!$OMP END PARALLEL ! { dg-error "Unexpected" }
!$OMP PARALLEL & ! { dg-error "Unclassifiable OpenMP" }
!
-!$ & NUM_THREADS(2) ! { dg-error "Unclassifiable|Invalid character" }
+!$ & NUM_THREADS(2) ! { dg-error "Invalid character" }
!$OMP END PARALLEL ! { dg-error "Unexpected" }
END PROGRAM
diff --git a/gcc/testsuite/gfortran.dg/pr36192.f90 b/gcc/testsuite/gfortran.dg/pr36192.f90
index ebf95e3..7ff5315 100644
--- a/gcc/testsuite/gfortran.dg/pr36192.f90
+++ b/gcc/testsuite/gfortran.dg/pr36192.f90
@@ -4,5 +4,5 @@
program three_body
real, parameter :: n = 2, d = 2
real, dimension(n,d) :: x ! { dg-error "Expecting a scalar INTEGER" }
- x(1,:) = (/ 1.0, 0.0 /) ! { dg-error "Unclassifiable" }
+ x(1,:) = (/ 1.0, 0.0 /)
end program three_body
diff --git a/gcc/testsuite/gfortran.dg/pr56007.f90 b/gcc/testsuite/gfortran.dg/pr56007.f90
index b91baf5..e6f0e9c 100644
--- a/gcc/testsuite/gfortran.dg/pr56007.f90
+++ b/gcc/testsuite/gfortran.dg/pr56007.f90
@@ -5,7 +5,7 @@
integer iw1(90), doiw1(90)
do iw1=1,2 ! { dg-error "cannot be an array" }
end do ! { dg-error "Expecting END PROGRAM statement" }
- do iw1(1)=1 ! { dg-error "Unclassifiable statement" }
+ do iw1(1)=1
do iw1=1 ! { dg-error "cannot be an array" }
end do ! { dg-error "Expecting END PROGRAM statement" }
END program
diff --git a/gcc/testsuite/gfortran.dg/pr56520.f90 b/gcc/testsuite/gfortran.dg/pr56520.f90
index b074b80..82bd7f9 100644
--- a/gcc/testsuite/gfortran.dg/pr56520.f90
+++ b/gcc/testsuite/gfortran.dg/pr56520.f90
@@ -6,8 +6,8 @@ program misleading
real a, c
a = 1.0
c = exp(+a) ) ! { dg-error "Unclassifiable statement" }
- c = exp(-a) ) ! { dg-error "Unclassifiable statement" }
- c = exp((a)) ) ! { dg-error "Unclassifiable statement" }
- c = exp(a) ) ! { dg-error "Unclassifiable statement" }
+ c = exp(-a) )
+ c = exp((a)) )
+ c = exp(a) )
c = exp(a)
end program misleading
diff --git a/gcc/testsuite/gfortran.dg/pr78741.f90 b/gcc/testsuite/gfortran.dg/pr78741.f90
index 707b299..6eb8578 100644
--- a/gcc/testsuite/gfortran.dg/pr78741.f90
+++ b/gcc/testsuite/gfortran.dg/pr78741.f90
@@ -11,6 +11,6 @@ entry g(n, x) ! { dg-error "is already defined" }
x = 'b'
contains
subroutine g ! { dg-error "(1)" }
- z(1) = x(1:1) ! { dg-error "Unclassifiable statement" }
+ z(1) = x(1:1)
end
end
diff --git a/gcc/testsuite/gfortran.dg/print_fmt_2.f90 b/gcc/testsuite/gfortran.dg/print_fmt_2.f90
index c7a5cc1..f194c11 100644
--- a/gcc/testsuite/gfortran.dg/print_fmt_2.f90
+++ b/gcc/testsuite/gfortran.dg/print_fmt_2.f90
@@ -7,5 +7,5 @@ real x
namelist /mynml/ x
printf, "check" ! { dg-error "Unclassifiable" }
x = 1
-printmynml ! { dg-error "" }
+printmynml
end
diff --git a/gcc/testsuite/gfortran.dg/select_type_20.f90 b/gcc/testsuite/gfortran.dg/select_type_20.f90
index a247f7b..65087a9 100644
--- a/gcc/testsuite/gfortran.dg/select_type_20.f90
+++ b/gcc/testsuite/gfortran.dg/select_type_20.f90
@@ -15,21 +15,21 @@ module gfcbug111
contains
- function my_dot_v_v (this,a,b) ! { dg-error "has no IMPLICIT type" }
+ function my_dot_v_v (this,a,b) ! { dg-error "has no IMPLICIT type" }
class(trivial_inner_product_type), intent(in) :: this
class(vector_class), intent(in) :: a,b ! { dg-error "Derived type" }
real :: my_dot_v_v
- select type (a)
- class is (trivial_vector_type) ! { dg-error "Syntax error in CLASS IS" }
- select type (b) ! { dg-error "Expected TYPE IS" }
- class is (trivial_vector_type) ! { dg-error "Syntax error in CLASS IS" }
+ select type (a) ! { dg-error "Selector shall be polymorphic" }
+ class is (trivial_vector_type) ! { dg-error "Syntax error in CLASS IS" }
+ select type (b) ! { dg-error "Expected TYPE IS" }
+ class is (trivial_vector_type) ! { dg-error "Syntax error in CLASS IS" }
class default
end select
- class default ! { dg-error "Unclassifiable statement" }
+ class default
end select ! { dg-error "Expecting END FUNCTION" }
end function my_dot_v_v
end module gfcbug111
select type (a)
-! { dg-excess-errors "Unexpected end of file" }
+! { dg-prune-output "Unexpected end of file" }