https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93289
Bug ID: 93289 Summary: array constructor of different length: Missing diagnostic when PARAMETER is in list Product: gcc Version: unknown Status: UNCONFIRMED Keywords: accepts-invalid, diagnostic Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: burnus at gcc dot gnu.org Target Milestone: --- The following code has different string lengths in the array constructor. If only string literals are used, an error is printed. But if the first argument is a PARAMETER, seemingly no checking is done. character(len=*), parameter :: str = "abj", str2 = "1234" print *, ["ab", "hjf333", str] ! Error: Different CHARACTER lengths (2/6) in array... print *, ["ab", str2] ! Error -> OK print *, [str, "ab", "hjf333"] ! Accepted, why? print *, [str, str2] ! Accepted, why? end