llvm / llvm/llvm-project

[Flang] Missing error for MODULE prefix in abstract interface body

Open
#208,200 3 comments 0 reactions 1 assignee Claimed by @ejose02 View on GitHub
accepts-invalid flang:frontend
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

Flang fails to diagnose an invalid `MODULE` prefix on a function declared inside an ABSTRACT INTERFACE block.

Expected behavior: The code should be rejected at compile time. Per the Fortran standard, MODULE may appear only in the function or subroutine of a module subprogram, or of a nonabstract interface body declared in the scoping unit of a module or submodule.

Actual behavior: Flang compiles the program successfully with no diagnostic.

Reproducer:

```Fortran
Module mod_test
Abstract Interface
Pure Integer Module Function f1(i)
Integer, Intent(In) :: i
End Function
End Interface
End Module

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.