]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR fortran/71861 ([F03] ICE in write_symbol(): bad module symbol)
authorJanus Weil <janus@gcc.gnu.org>
Mon, 25 Mar 2019 19:58:04 +0000 (20:58 +0100)
committerJanus Weil <janus@gcc.gnu.org>
Mon, 25 Mar 2019 19:58:04 +0000 (20:58 +0100)
fix PR 71861

2019-03-25  Janus Weil  <janus@gcc.gnu.org>

PR fortran/71861
* symbol.c (check_conflict): ABSTRACT attribute conflicts with
INTRINSIC attribute.

2019-03-25  Janus Weil  <janus@gcc.gnu.org>

PR fortran/71861
* gfortran.dg/interface_abstract_5.f90: New test case.

From-SVN: r269922

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

index 67e0922adba0d0832165a0d0eb6dc3edfc9c5ca9..03ae0852d41801a0d8b3125abb4a52cafe8eb1b3 100644 (file)
@@ -1,3 +1,10 @@
+2019-03-25  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/71861
+       Backport from trunk
+       * symbol.c (check_conflict): ABSTRACT attribute conflicts with
+       INTRINSIC attribute.
+
 2019-03-23  Thomas Koenig  <tkoeng@gcc.gnu.org>
 
        PR fortran/68009
index d42f2ed5bee9dd6f5a5342d97ac52804b48e593b..44e15d039f41f2cc4332d6b97d6bcfbf30c8eb84 100644 (file)
@@ -509,6 +509,7 @@ check_conflict (symbol_attribute *attr, const char *name, locus *where)
 
   conf (external, intrinsic);
   conf (entry, intrinsic);
+  conf (abstract, intrinsic);
 
   if ((attr->if_source == IFSRC_DECL && !attr->procedure) || attr->contained)
     conf (external, subroutine);
index 6bff0f9f4e8755597b025140b2832fc73ebd9c94..4ca1066d91a96c432f6aea48bf0344424feef55f 100644 (file)
@@ -1,3 +1,9 @@
+2019-03-25  Janus Weil  <janus@gcc.gnu.org>
+
+       PR fortran/71861
+       Backport from trunk
+       * gfortran.dg/interface_abstract_5.f90: New test case.
+
 2019-03-21  Thomas Schwinge  <thomas@codesourcery.com>
 
        PR fortran/56408
diff --git a/gcc/testsuite/gfortran.dg/interface_abstract_5.f90 b/gcc/testsuite/gfortran.dg/interface_abstract_5.f90
new file mode 100644 (file)
index 0000000..fddf6b8
--- /dev/null
@@ -0,0 +1,32 @@
+! { dg-do compile }
+!
+! PR 71861: [7/8/9 Regression] [F03] ICE in write_symbol(): bad module symbol
+!
+! Contributed by Gerhard Steinmetz <gerhard.steinmetz.fortran@t-online.de>
+
+module m1
+   intrinsic abs
+   abstract interface
+      function abs(x)    ! { dg-error "ABSTRACT attribute conflicts with INTRINSIC attribute" }
+         real :: abs, x
+      end
+   end interface
+end
+
+module m2
+   abstract interface
+      function abs(x)
+         real :: abs, x
+      end
+   end interface
+   intrinsic abs    ! { dg-error "ABSTRACT attribute conflicts with INTRINSIC attribute" }
+end
+
+module m3
+   abstract interface
+      function f(x)
+         real :: f, x
+      end
+   end interface
+   intrinsic f    ! { dg-error "ABSTRACT attribute conflicts with INTRINSIC attribute" }
+end