Issue 161694
Summary [flang] Flang seems too restrictive on specification _expression_ usage.
Labels flang:frontend
Assignees
Reporter DanielCChen
    Consider the following code
```
    type A (p, r)
        integer, kind :: p, r
 real (selected_real_kind(p, r)) :: data
    end type
    type(a(6,23)) :: a1
    print*, a1%data%kind

end
```

Flang failed at the compile time with
```
error: Semantic errors in t.f
./t.f:3:15: error: Must be a constant value
          real (selected_real_kind(p, r)) :: data
 ^^^^^^^^^^^^^^^^^^^^^^^^
```

All ifort, gfortran and XLF compile and execute the code successfully.
The folding of `selected_real_kind` could occur when the type is instantiated.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to