Intel compiler giving error due to whitespace in assumed rank dummy argument declaration
04:31 01 Dec 2025

Consider the following code:

Module assumed_rank_module

  Implicit None

Contains

  Pure Function assumed_rank( a ) Result( s )

    Integer :: s

    Real, Dimension( .. ), Intent( In ) :: a

    s = Size( a )

  End Function assumed_rank
  
End Module assumed_rank_module

Gfortran is happy with this:

ijb87_local@SCLT517LINUX:~/play/stack$ gfortran --version
GNU Fortran (GCC) 15.2.0
Copyright © 2025 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

ijb87_local@SCLT517LINUX:~/play/stack$ gfortran -c -Wall -Wextra -pedantic -fcheck=all -std=f2018 -Og -g ass_rank.f90 
ijb87_local@SCLT517LINUX:~/play/stack$ 

Amdflang is happy with this:

ijb87_local@SCLT517LINUX:~/play/stack$ amdflang --version
AMD AFAR drop #6.0 03/23/25 flang version 21.0.0git (ssh://github-emu/AMD-Lightning-Internal/llvm-project  25126 b659d5b9bd0f2e3a0111a02e93ec1b3fa38a39a7)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/ijb87_local/tools/amd/rocm-afar-7450-drop-6.0.0/lib/llvm/bin
Build config: +assertions
Configuration file: /home/ijb87_local/tools/amd/rocm-afar-7450-drop-6.0.0/lib/llvm/bin/flang.cfg
ijb87_local@SCLT517LINUX:~/play/stack$ amdflang -c -O ass_rank.f90
ijb87_local@SCLT517LINUX:~/play/stack$ 

Even the nvidia compiler is happy with this (after I had taken out ( Type, External ) on Implicit None ...):

ijb87_local@SCLT517LINUX:~/play/stack$ /opt/nvidia/hpc_sdk/Linux_x86_64/25.9/compilers/bin/nvfortran --version
nvfortran 25.9-0 64-bit target on x86-64 Linux -tp alderlake 
NVIDIA Compilers and Tools
Copyright (c) 2025, NVIDIA CORPORATION & AFFILIATES.  All rights reserved.
ijb87_local@SCLT517LINUX:~/play/stack$ /opt/nvidia/hpc_sdk/Linux_x86_64/25.9/compilers/bin/nvfortran -c ass_rank.f90 
ijb87_local@SCLT517LINUX:~/play/stack$ 

However ifx complains about, of all things, the space after the .. :

ijb87_local@SCLT517LINUX:~/play/stack$ ifx --version
ifx (IFX) 2025.2.0 20250605
Copyright (C) 1985-2025 Intel Corporation. All rights reserved.

ijb87_local@SCLT517LINUX:~/play/stack$ ifx -c ass_rank.f90
ass_rank.f90(11): error #5145: Invalid blank/tab
    Real, Dimension( .. ), Intent( In ) :: a
-----------------------^
compilation aborted for ass_rank.f90 (code 1)

If I remove that space ifx is happy:

ijb87_local@SCLT517LINUX:~/play/stack$ cat ass_rank.f90
Module assumed_rank_module

  Implicit None

Contains

  Pure Function assumed_rank( a ) Result( s )

    Integer :: s

    Real, Dimension( ..), Intent( In ) :: a

    s = Size( a )

  End Function assumed_rank
  
End Module assumed_rank_module
ijb87_local@SCLT517LINUX:~/play/stack$ ifx -c ass_rank.f90
ijb87_local@SCLT517LINUX:~/play/stack$ 

Now ifx has found for me some subtle issues to do with language conformance before, but this just looks wrong. But before I complain to Intel can somebody just confirm I am not going mad?

fortran language-lawyer gfortran intel-fortran