re PR fortran/36534 (Bogus: '__convert_s1_s4' at (1) is obsolescent in fortran 95)
authorFrancois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sat, 4 Oct 2014 10:18:07 +0000 (10:18 +0000)
committerFrançois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Sat, 4 Oct 2014 10:18:07 +0000 (10:18 +0000)
PR fortran/36534

* resolve.c (resolve_fl_procedure): Clean up obsolescence warning.
* gfortran.dg/widechar_10.f90: New test.

From-SVN: r215887

gcc/fortran/ChangeLog
gcc/fortran/resolve.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/widechar_10.f90 [new file with mode: 0644]

index 8a781ad46b08c3cab4037c9f4e7b6928829a58b5..03b3b66a8dd50a08defa2c2ff442710d3550de1e 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-04  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/36534
+       * resolve.c (resolve_fl_procedure): Clean up obsolescence warning.
+
 2014-09-25  Tobias Burnus  <burnus@net-b.de>
 
        * check.c (check_co_collective): Renamed from check_co_minmaxsum,
index 4b8f3b12a9596388f9e2977ecec1b9a852b945b8..30ee175d2aced4e26b9eb4ce2e7cc895469df713 100644 (file)
@@ -11266,11 +11266,11 @@ resolve_fl_procedure (gfc_symbol *sym, int mp_flag)
        }
 
       /* Appendix B.2 of the standard.  Contained functions give an
-        error anyway.  Fixed-form is likely to be F77/legacy. Deferred
-        character length is an F2003 feature.  */
-      if (!sym->attr.contained
-           && gfc_current_form != FORM_FIXED
-           && !sym->ts.deferred)
+        error anyway.  Deferred character length is an F2003 feature.
+        Don't warn on intrinsic conversion functions, which start
+        with two underscores.  */
+      if (!sym->attr.contained && !sym->ts.deferred
+         && (sym->name[0] != '_' || sym->name[1] != '_'))
        gfc_notify_std (GFC_STD_F95_OBS,
                        "CHARACTER(*) function '%s' at %L",
                        sym->name, &sym->declared_at);
index 2293926ea893f59b333933f1d9733372f0e8ff8c..9db549ee6d304718defd6dc264a837786ef25cb9 100644 (file)
@@ -1,3 +1,8 @@
+2014-10-04  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+       PR fortran/36534
+       * gfortran.dg/widechar_10.f90: New test.
+
 2014-10-03  Jan Hubicka  <hubicka@ucw.cz>
 
        * testsuite/g++.dg/ipa/devirt-42.C: New testcase.
diff --git a/gcc/testsuite/gfortran.dg/widechar_10.f90 b/gcc/testsuite/gfortran.dg/widechar_10.f90
new file mode 100644 (file)
index 0000000..19f0ab3
--- /dev/null
@@ -0,0 +1,6 @@
+! { dg-do compile }
+! { dg-options "-pedantic" }
+! PR fortran/36534
+CHARACTER (kind=4,len=*) MY_STRING4(1:3)
+PARAMETER ( MY_STRING4 = (/ "A" , "B", "C" /) )
+end