以下をコンパイルしようとしましたが、gfortran と ifort の両方で構文エラーが報告されました。
module test
implicit real*8 (a-h,o-z)
allocatable, save :: A(:)
end module test
これはgfortran -c test.f90
出力です:
allocatable, save :: A(:)
1
Error: Invalid character in name at (1)
そしてifort -c test.f90
出力:
test.f90(3): error #5277: Syntax error, found ',' following statement keyword
allocatable, save :: A(:)
------------^
test.f90(3): error #5082: Syntax error, found '::' when expecting one of: ( , <END-OF-STATEMENT> ; [
allocatable, save :: A(:)
------------------^
compilation aborted for test.f90 (code 1)
ただし、save
属性がない場合、または明示的な型を追加することにより、正常にコンパイルされます。
module test
implicit real*8 (a-h,o-z)
allocatable :: A(:)
end module test
module test
implicit real*8 (a-h,o-z)
real*8, allocatable, save :: A(:)
end module test
両方のコンパイラが構文エラーを報告するので、これはバグなのか、それとも何が間違っているのか誰かが知っているのだろうか?