Nvfortran issue with assigning default values to derived type components

I have an issue with nvfortran (21.2) that I think is either a compiler bug or an unimplemented 2008/2018 feature.

Attempting to compiler the following derived type generates the follwoing error messages

NVFORTRAN-S-0091-Constant expression of wrong data type (nverror.F90: 18)
NVFORTRAN-S-0091-Constant expression of wrong data type (nverror.F90: 18)
NVFORTRAN-S-0091-Constant expression of wrong data type (nverror.F90: 18)
NVFORTRAN-S-0091-Constant expression of wrong data type (nverror.F90: 18)
0 inform, 0 warnings, 4 severes, 0 fatal for nverror

The derived type is a C-interoperable type designed to communicate with C routines. Here is a stripped down version of the original code. Note I tried two different ways to initialize the arrays but I think the issue is with the C_PTR components. Any help would be appreciated

Thanks

RW

Module nverror

USE, Intrinsic :: ISO_FORTRAN_ENV
USE, Intrinsic :: ISO_C_BINDING

Type, BIND© :: c_bbox ! C bounding box object

Type(C_PTR)    :: emax      = C_NULL_PTR
Type(C_PTR)    :: emin      = C_NULL_PTR
Integer(C_INT) :: imin      = 0_C_INT
Integer(C_INT) :: imax      = 0_C_INT
Type(C_PTR)    :: e2max(3)  = C_NULL_PTR
Type(C_PTR)    :: e2min(3)  = C_NULL_PTR
Real(C_DOUBLE) :: etol(3)   = 0.0_C_DOUBLE

! Type(C_PTR) :: e2max(3) = [C_NULL_PTR, C_NULL_PTR, C_NULL_PTR]
! Type(C_PTR) :: e2min(3) = [C_NULL_PTR, C_NULL_PTR, C_NULL_PTR]
! Real(C_DOUBLE) :: etol(3) = [0.0_C_DOUBLE, 0.0_C_DOUBLE, 0.0_C_DOUBLE]
End Type

End Module nverror

Forgot to add that gcc 10.1 and Intel oneAPI compilers both accept this
code as valid and compile with no errors

Thanks! I agree that it’s most likely a compiler issue so I added problem report, TPR #29699. We’ll have engineering investigate further.

-Mat

FYI, TPR #29699 was fixed in the 21.5 release. Apologies for the late notification.

-Mat