Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

implicit class

Nicholas_B_
Beginner
774 Views

Intel Visual Fortran falis to compile implicit class statements such as:

implicit class(foo) (a-b)
implicit class(*) (c)

gfortran had the same bug which was fixed in gfortran 4.9: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56500

Trying to compile the code from the gfortran bug report gives:

Compiling with Intel(R) Visual Fortran Compiler XE 15.0.2.179 [IA-32]...
ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc120.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qvc12 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\\bin" "C:\Users\Nicholas\Documents\imp_bug\implicitclass\Source1.f90"
C:\Users\Nicholas\Documents\imp_bug\implicitclass\Source1.f90(8): error #5082: Syntax error, found '(' when expecting one of: (
  implicit class(foo) (a-b)
----------------------^
C:\Users\Nicholas\Documents\imp_bug\implicitclass\Source1.f90(9): error #5082: Syntax error, found '(' when expecting one of: (
  implicit class(*) (c)
--------------------^
(trimmed)

Is this a known bug?

This usage is relevant for people trying to simulate generic programming (templates) using a combination of implict, include and renaming in use statements.

Nick

 

 

0 Kudos
2 Replies
Steven_L_Intel1
Employee
774 Views

Interesting. I had not thought this was legal Fortran, but it is. It could be something we overlooked. I will let the developers know. Issue ID is DPD200368505.

0 Kudos
Steven_L_Intel1
Employee
774 Views

We've now fixed this for a release later this year. Thanks for bringing it to our attention.

This illustrates a general problem many compiler developers have had in not catching all of the changes from one standard version to the next. It's why the 2015 standard will include, in its introduction, a summary of EVERY new feature and change.

0 Kudos
Reply