]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/40728 (Bogus error "Error: Can't convert UNKNOWN to REAL(8) at (1)")
authorDaniel Franke <franke.daniel@gmail.com>
Fri, 7 May 2010 15:36:45 +0000 (11:36 -0400)
committerDaniel Franke <dfranke@gcc.gnu.org>
Fri, 7 May 2010 15:36:45 +0000 (11:36 -0400)
gcc/fortran/:
2010-05-07  Daniel Franke  <franke.daniel@gmail.com>

PR fortran/40728
* intrinc.c (gfc_is_intrinsic): Do not prematurely mark symbol
        as external

gcc/testsuite/:
2010-05-07  Daniel Franke  <franke.daniel@gmail.com>

        PR fortran/40728
        * gfortran.dg/coarray_1.f90: Fixed error message.
        * gfortran.dg/selected_char_kind_3.f90: Fixed error message.
        * gfortran.dg/intrinsic_std_1.f90: Fixed bogus message.
        * gfortran.dg/intrinsic_std_5.f90: New.

From-SVN: r159155

gcc/fortran/ChangeLog
gcc/fortran/intrinsic.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/coarray_1.f90
gcc/testsuite/gfortran.dg/intrinsic_std_1.f90
gcc/testsuite/gfortran.dg/intrinsic_std_5.f03 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/selected_char_kind_3.f90

index 4c42faac88eaa612255e3f846ff1af9905bf960d..97e002a1a1981159c1e9d77d255ac8df4c500f7a 100644 (file)
@@ -1,3 +1,9 @@
+2010-05-07  Daniel Franke  <franke.daniel@gmail.com>
+
+       PR fortran/40728
+       * intrinc.c (gfc_is_intrinsic): Do not prematurely mark symbol
+        as external
+
 2010-05-07  Jason Merrill  <jason@redhat.com>
 
        * trans-expr.c (gfc_conv_procedure_call): Rename nullptr to null_ptr
@@ -17,6 +23,7 @@
 
 2010-05-05  Daniel Franke  <franke.daniel@gmail.com>
 
+       PR fortran/32331
        * resolve.c (traverse_data_list): Rephrase error message for
        non-constant bounds in data-implied-do.
 
index 34afabc3d2237d394ee0e1601d52598143acbfd0..e8041eb9b9a14415247c3ae9726a3a1b99053133 100644 (file)
@@ -956,17 +956,14 @@ gfc_is_intrinsic (gfc_symbol* sym, int subroutine_flag, locus loc)
   /* See if this intrinsic is allowed in the current standard.  */
   if (gfc_check_intrinsic_standard (isym, &symstd, false, loc) == FAILURE)
     {
-      if (sym->attr.proc == PROC_UNKNOWN)
-       {
-         if (gfc_option.warn_intrinsics_std)
-           gfc_warning_now ("The intrinsic '%s' at %L is not included in the"
-                            " selected standard but %s and '%s' will be"
-                            " treated as if declared EXTERNAL.  Use an"
-                            " appropriate -std=* option or define"
-                            " -fall-intrinsics to allow this intrinsic.",
-                            sym->name, &loc, symstd, sym->name);
-         gfc_add_external (&sym->attr, &loc);
-       }
+      if (sym->attr.proc == PROC_UNKNOWN
+         && gfc_option.warn_intrinsics_std)
+       gfc_warning_now ("The intrinsic '%s' at %L is not included in the"
+                        " selected standard but %s and '%s' will be"
+                        " treated as if declared EXTERNAL.  Use an"
+                        " appropriate -std=* option or define"
+                        " -fall-intrinsics to allow this intrinsic.",
+                        sym->name, &loc, symstd, sym->name);
 
       return false;
     }
index 2ddbe951209b4eafd76b9c4ef0389d0a2db65222..297ae761ddd9d558ab01ad25a45ab0b0cec75eb8 100644 (file)
@@ -1,3 +1,11 @@
+2010-05-07  Daniel Franke  <franke.daniel@gmail.com>
+
+        PR fortran/40728
+        * gfortran.dg/coarray_1.f90: Fixed error message.
+        * gfortran.dg/selected_char_kind_3.f90: Fixed error message.
+        * gfortran.dg/intrinsic_std_1.f90: Fixed bogus message.
+        * gfortran.dg/intrinsic_std_5.f90: New.
+
 2010-05-07  Jason Merrill  <jason@redhat.com>
 
        * g++.dg/cpp0x/nullptr20.C: Use sprintf.
index ba10d64a3ef7fab7e5badbd80df9bb994263281b..7fd4c84240f2cc2e6ee0f9e0cb7c890b61a22fed 100644 (file)
@@ -13,6 +13,6 @@ sync memory  ! { dg-error "Fortran 2008:" }
 sync images(*)  ! { dg-error "Fortran 2008:" }
 
 ! num_images is implicitly defined:
-n = num_images()  ! { dg-error "convert UNKNOWN to INTEGER" }
+n = num_images()  ! { dg-error "has no IMPLICIT type" }
 error stop 'stop'  ! { dg-error "Fortran 2008:" }
 end
index 9c97b7eaa5d61122332e815dc18bceca1b6fe43b..290b54c2cb449f6131c085f19dfce6b344081ea5 100644 (file)
@@ -20,7 +20,7 @@ SUBROUTINE no_implicit
   ! ASINH is an intrinsic of F2008
   ! The warning should be issued in the declaration above where it is declared
   ! EXTERNAL.
-  WRITE (*,*) ASINH (1.) ! { dg-bogus "Fortran 2008" }
+  WRITE (*,*) ASINH (1.) ! { dg-warning "Fortran 2008" }
 END SUBROUTINE no_implicit
 
 SUBROUTINE implicit_type
diff --git a/gcc/testsuite/gfortran.dg/intrinsic_std_5.f03 b/gcc/testsuite/gfortran.dg/intrinsic_std_5.f03
new file mode 100644 (file)
index 0000000..f5c0f2d
--- /dev/null
@@ -0,0 +1,24 @@
+! { dg-do compile }
+! { dg-options "-std=f2003" }
+!
+! PR fortran/40728
+!
+
+! bogus error
+SUBROUTINE s1
+  IMPLICIT NONE
+  real(4), volatile :: r4
+
+  r4 = 0.0_4
+  r4 = asinh(r4)         ! { dg-error "has no IMPLICIT type" }
+END SUBROUTINE
+
+
+
+! ICE on invalid (ATANH is defined by F2008 only)
+SUBROUTINE s2
+  IMPLICIT NONE
+  real :: r
+  r = 0.4
+  print *, atanh(r)      ! { dg-error "has no IMPLICIT type" }
+END SUBROUTINE
index 59bc18f1f6fc30d49e95d08e3dfcbd7fc8f40761..fad5e46c287b7dcfb9a886e87d1c503614cf6ccc 100644 (file)
@@ -4,7 +4,7 @@
 ! Check that SELECTED_CHAR_KIND is rejected with -std=f95
 !
   implicit none
-  character(kind=selected_char_kind("ascii")) :: s ! { dg-error "must be an intrinsic function" }
+  character(kind=selected_char_kind("ascii")) :: s ! { dg-error "has no IMPLICIT type" }
   s = "" ! { dg-error "has no IMPLICIT type" }
   print *, s
 end