NVFORTRAN-S-0034-Syntax error at or near %

Hi,
when trying to compile the following piece of code with nvfortran:

module c_data
  implicit none
!----------Define Parameter--------------
 type,public :: f
         integer::f1
         integer::f2
 end type f
 type (f),parameter::fk=f(1,2)
!---------------C-----------------------
  TYPE, PUBLIC :: CTYPE
  INTEGER :: D(3)
  END TYPE CTYPE
  TYPE (CTYPE) :: C
!
data C%D /fk%f1,2,3/

end module c_data

I get the following error message:

 nvfortran -c   test2.F90 
NVFORTRAN-S-0034-Syntax error at or near % (test2.F90: 15)
  0 inform,   0 warnings,   1 severes, 0 fatal for c_data

Is this a compiler bug? The code compiles with gfortran, ifort and ifx without any complains.

Thanks for the report Markus_Oppel. It’s a compiler issue. I’ve filed a problem report, TPR#32613, and sent it to engineering for review.

The work around would be to construct the type as follows:

module c_data
  implicit none
!----------Define Parameter--------------
 type,public :: f
         integer::f1
         integer::f2
 end type f
 type (f),parameter::fk=f(1,2)
!---------------C-----------------------
  TYPE, PUBLIC :: CTYPE
  INTEGER :: D(3)
  END TYPE CTYPE
  TYPE (CTYPE) :: C = CTYPE([fk%f1,2,3])

end module c_data

Thanks again,
Mat

Hi Mat,

thanks for the quick reply and for confirming the bug. I will try a workaround, based on your suggestion, until the bug is fixed.
Thanks again,
Markus