https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65141
Bug ID: 65141 Summary: ISO_10646 constant parameters convert kind when used with substring references Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: zbeekman at gmail dot com Substring references with ISO_10646 kind characters cause the resulting expression to be DEFAULT kind rather than ISO_10646. Reproducer: program ISO_CONST_SUBST_PR implicit none integer, parameter :: UNICODE=selected_char_kind('ISO_10646') integer, parameter :: DEFAULT=selected_char_kind('DEFAULT') character(kind=UNICODE,len=*),parameter :: string='my string' write(*,'(A, I0, A, I0)') 'Unicode and default character kinds are: ',UNICODE,', ',DEFAULT write(*,'(A, I0)') 'kind(string) should be UNICODE and is UNICODE for me: ',kind(string) write(*,'(A, I0)') 'kind(string(2:4)) should be UNICODE and is DEFAULT for me: ',kind(string(2:4)) end program ISO_CONST_SUBST_PR