<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Bug with IMPORT statement in submodule in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1745438#M178729</link>
    <description>&lt;P&gt;This confirmed bug is still present in 2025.3.2. Was a bug report ever written for this, or did it fall in a crack somewhere?&lt;/P&gt;</description>
    <pubDate>Wed, 22 Apr 2026 21:48:39 GMT</pubDate>
    <dc:creator>OP1</dc:creator>
    <dc:date>2026-04-22T21:48:39Z</dc:date>
    <item>
      <title>Bug with IMPORT statement in submodule</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1605840#M172511</link>
      <description>&lt;P&gt;The following code triggers a spurious compiler error.&lt;/P&gt;&lt;P&gt;My understanding is that the variable J is "&lt;SPAN&gt;the name of one or more entities accessible in the host scoping unit" (per the documentation) and therefore its use in the IMPORT statement should be valid.&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;MODULE M
IMPLICIT NONE (TYPE, EXTERNAL)
INTEGER, PARAMETER :: J = 1
END MODULE M


MODULE N
USE M
IMPLICIT NONE (TYPE, EXTERNAL)
INTERFACE
    MODULE SUBROUTINE S
    END SUBROUTINE S
END INTERFACE
END MODULE N


SUBMODULE (N) S
IMPORT, ONLY : S, J   ! This line triggers a compiler error.
IMPLICIT NONE (TYPE, EXTERNAL)
CONTAINS
    MODULE SUBROUTINE S
    IMPLICIT NONE (TYPE, EXTERNAL)
    WRITE(*, *) J
    END SUBROUTINE S
END SUBMODULE S&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 21:44:40 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1605840#M172511</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2024-06-11T21:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with IMPORT statement in submodule</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1605857#M172512</link>
      <description>&lt;P&gt;I'll have to get our Standards members to look at this one.&amp;nbsp; First, ifx is in agreement with gfortran 13 and Nag that this IMPORT is illegal.&amp;nbsp; That is not to say that all 3 are right.&amp;nbsp; Perhaps all 3 compilers are getting this wrong.&amp;nbsp; Surely this deserves a more in-depth analysis with the Standard experts.&amp;nbsp;&amp;nbsp;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/88548"&gt;@OP1&lt;/a&gt;&amp;nbsp;your code is usually conformant so I'm inclined to side with you that this should be legal.&amp;nbsp; My reading would suggest the IMPORT has to go in the INTERFACE in MODULE N.&amp;nbsp; But with submodules my intuition may be flawed.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 23:12:10 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1605857#M172512</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2024-06-11T23:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with IMPORT statement in submodule</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1606029#M172516</link>
      <description>&lt;P&gt;F2018 had significant changes in IMPORT and from my initial reading I think it may be valid.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 08:18:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1606029#M172516</guid>
      <dc:creator>andrew_4619</dc:creator>
      <dc:date>2024-06-12T08:18:33Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with IMPORT statement in submodule</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1606226#M172525</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/88548"&gt;@OP1&lt;/a&gt;&amp;nbsp;Jon Steidel agrees with you, it seems valid.&amp;nbsp; I will start a bug report for ifx.&amp;nbsp; His further analysis&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;Fortran 2018 expanded the use of the IMPORT statement to allow it in BLOCKs, internal procedures, and module procedures. There is a constraint&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C8100&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; An IMPORT statement shall not appear in the scoping unit of a main-program, external-subprogram, module, or block-data&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;which does not prohibit it in a submodule.&amp;nbsp; Then there is another constraint&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C8103&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IMPORT, NONE shall not appear in the scoping unit of a submodule&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P style="font-weight: 400;"&gt;So, it seems that this test case is valid.&amp;nbsp; I wrote a couple simple tests and it appears NAG and gfortran have not yet implemented this F2018 feature. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 20:02:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1606226#M172525</guid>
      <dc:creator>Ron_Green</dc:creator>
      <dc:date>2024-06-12T20:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with IMPORT statement in submodule</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1606243#M172527</link>
      <description>&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/52256"&gt;@Ron_Green&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.intel.com/t5/user/viewprofilepage/user-id/66560"&gt;@andrew_4619&lt;/a&gt;&amp;nbsp;and Jon Steidel pointed you in the right direction.&amp;nbsp; And you are very likely correct in that both gfortran and NAG Fortran might yet have to catch up to this Fortran 2018 facility.&amp;nbsp; But here I thought I saw a blurb some place NAG Fortran is now conformant with Fortran 2018; if so, this is likely a bug in that compiler.&lt;/P&gt;&lt;P&gt;Anyways, you can pass this simpler variant to the Intel Fortran team which is processed as expected by IFX 2024.1.0 version (and that is really cool).&amp;nbsp; So the issue here is very likely when it comes to entities in a MODULE that are introduced via USE association rather than declared in the module itself.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="fortran"&gt;MODULE N
IMPLICIT NONE (TYPE, EXTERNAL)
INTEGER, PARAMETER :: J = 1
INTERFACE
    MODULE SUBROUTINE S
    END SUBROUTINE S
END INTERFACE
END MODULE N


SUBMODULE (N) S
IMPORT, ONLY : S, J
IMPLICIT NONE (TYPE, EXTERNAL)
CONTAINS
    MODULE SUBROUTINE S
    IMPLICIT NONE (TYPE, EXTERNAL)
    WRITE(*, *) J
    END SUBROUTINE S
END SUBMODULE S&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="none"&gt;C:\temp&amp;gt;ifx /c /standard-semantics /free n.f
Intel(R) Fortran Compiler for applications running on Intel(R) 64, Version 2024.1.0 Build 20240308
Copyright (C) 1985-2024 Intel Corporation. All rights reserved.


C:\temp&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2024 21:17:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1606243#M172527</guid>
      <dc:creator>FortranFan</dc:creator>
      <dc:date>2024-06-12T21:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with IMPORT statement in submodule</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1745438#M178729</link>
      <description>&lt;P&gt;This confirmed bug is still present in 2025.3.2. Was a bug report ever written for this, or did it fall in a crack somewhere?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Apr 2026 21:48:39 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1745438#M178729</guid>
      <dc:creator>OP1</dc:creator>
      <dc:date>2026-04-22T21:48:39Z</dc:date>
    </item>
    <item>
      <title>Re: Bug with IMPORT statement in submodule</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1746074#M178763</link>
      <description>&lt;P&gt;I confirmed the original code example still meets an error during compilation. I escalate this to the developer.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Apr 2026 14:36:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1746074#M178763</guid>
      <dc:creator>Shiquan_Su</dc:creator>
      <dc:date>2026-04-28T14:36:52Z</dc:date>
    </item>
    <item>
      <title>Re:Bug with IMPORT statement in submodule</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1746373#M178773</link>
      <description>&lt;P&gt;I don't think that it is a compiler bug.  Key rule that decides everything is C897 from F2018, §8.8 (IMPORT statement):&lt;/P&gt;&lt;P&gt;&lt;EM&gt;C897 (R867): Each import-name shall be the name of an entity in the host scoping unit.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;So, the question here is J an entity of the host scoping unit of the submodule?&lt;/P&gt;&lt;P&gt;If yes then IMPORT, ONLY : J is legal. If no, then it is required to be rejected by the compiler.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;In the second example, J is declared directly in MODULE N.&amp;nbsp;&lt;/P&gt;&lt;P&gt;J is an entity of the host scoping unit and IMPORT, ONLY : S, J satisfies C897&lt;/P&gt;&lt;P&gt;ifx doesn't emit an error in this case.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;In your original case (first example), J comes from USE M.&amp;nbsp;J is not declared in MODULE N and is declared in MODULE M.&lt;/P&gt;&lt;P&gt;MODULE N merely has USE association with M.  Since IMPORT only applies to host association, not USE association, J does not satisfy C897 in this case. Note that S is still allowed since it is declared in MODULE N (via the interface body).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 30 Apr 2026 15:39:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Bug-with-IMPORT-statement-in-submodule/m-p/1746373#M178773</guid>
      <dc:creator>Igor_V_Intel</dc:creator>
      <dc:date>2026-04-30T15:39:06Z</dc:date>
    </item>
  </channel>
</rss>

