flang
flang copied to clipboard
Flang does not flag an error when volatile is used in a Pure Subroutine
A pure procedure must not specify that any entity is VOLATILE. In addition, it must not contain any references to data that is VOLATILE. This minimal test runs all right with Flang, but it should raise an error for failVol:
Module test
Integer,Volatile :: failVol
Contains
Pure Subroutine sub_pure(a)
Integer,Intent(Out) :: a
a = a + failVol
End Subroutine
end module
Program fail
Use test
End Program