Re: No distinction between COMPLEX and CMPLX in gfortran

Andrew Pinski via Gcc <[email protected]>
Newsgroups gmane.comp.gcc.devel,gmane.comp.gcc.fortran
Message-ID <CALvbMcAzW30zSgH2mwk76BRu7Y=ycDaDCgDAc2Z=U1NmEHXbrQ@mail.gmail.com>
On Mon, Dec 29, 2025 at 10:50 PM Naveen Yadav via Gcc <[email protected]> wrote:
>
> Dear developers,
>
> I am using  GNU Fortran (GCC) 15.2.1 20251211 (Red Hat 15.2.1-5):
>
> The following program:
>
> ****************************************************************************************************
> PROGRAM test
> IMPLICIT NONE
> REAL :: a = 1.0, b=1.0
> COMPLEX:: z
>
> z = COMPLEX(1.0,2.0)
> PRINT*, z
>
> z = COMPLEX(a, b)
> PRINT*, z
>
> END PROGRAM test
> ****************************************************************************************************
>
> works with gfortran. However, the Intel compiler (from oneApi) throws a
> compile error:
>
> test.f90(6): error #6404: This name does not have a type, and must have an
> explicit type.   [COMPLEX]
> z = COMPLEX(1.0,2.0)
> ----^
> compilation aborted for test.f90 (code 1)
>
> It is because COMPLEX is the name of a type and CMPLX is an intrinsic
> function. The behaviour of the Intel compiler is the correct one. I hope
> this will be updated in a future release.

See https://gcc.gnu.org/onlinedocs/gcc-15.2.0/gfortran/COMPLEX.html#index-COMPLEX
```
Standard:
GNU extension
```

Thanks,
Andrew

>
> Best regards
> Naveen Yadav
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.