| Issue |
203820
|
| Summary |
[flang] Error not detected for statement function dummy name with EXTERNAL attribute used in data context
|
| Labels |
|
| Assignees |
|
| Reporter |
ejose02
|
Flang accepts a program unit where a statement function’s dummy argument is declared with the EXTERNAL attribute, but the same identifier appears in the statement-function definition in a data context. That is an inconsistent classification: the dummy cannot simultaneously be treated as an external procedure in the header and as a numeric operand in the _expression_. LLVM Flang currently compiles the example without any diagnostic and produces an executable.
Expected output: Compile time error with proper error message
Actual output: No error and no warning; compilation succeeds.
Reproducer:
```Fortran
real function fun(x)
real, external :: z
sf(z) = z + 10
fun = sf(x)
end function fun
print *, fun(30.0)
end
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs