Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28602 Discussions

Sequence of "Use" causes/masks an error

abhimodak
New Contributor I
299 Views
The snippet below will not give a compile time error. But I am thinking it should since the variable "first" is not accessible through module Two. The error is caught if Use One is written after Use Two in the program.

Abhi

------

Module One

Implicit None

Private

Integer :: first = 1

Public :: first

End Module One

Module Two

Use One

Implicit None

Private

Integer :: second = 2, third = 3

Public :: second

End Module Two

Program Test_Private

Use One ! This won't give an error.
Use Two, only: first, second
!Use One ! Comment the previous and Uncomment this will give an error.

Implicit None

Print *, first
Print *, second

End Program Test_Private
0 Kudos
1 Solution
Steven_L_Intel1
Employee
299 Views
I agree that this seems to be a bug. I'll report it - thanks. Issue ID is DPD200139378.

View solution in original post

0 Kudos
1 Reply
Steven_L_Intel1
Employee
300 Views
I agree that this seems to be a bug. I'll report it - thanks. Issue ID is DPD200139378.
0 Kudos
Reply