You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[flang] Accept initialized SAVE local in specification expression (#107656)
Specification expressions may contain references to dummy arguments,
host objects, module variables, and variables in COMMON blocks, since
they will have values on entry to the scope. A local variable with a
initializer and the SAVE attribute (which will always be implied by an
explicit initialization) will also always work, and is accepted by at
least one other compiler, so accept it with a warning.
!ERROR: Value of KIND type parameter 'typekind' must be constant
56
-
!ERROR: Invalid specification expression: reference to local entity 'nonconstval'
56
+
!PORTABILITY: specification expression refers to local object 'nonconstval' (initialized and saved)
57
57
type (derived(nonConstVal, 3)) :: nonConstDerivedKind
58
58
59
59
!OK because all type-params are constants
60
60
type (derived(3, constVal)) :: constDerivedLen
61
61
62
-
!ERROR: Invalid specification expression: reference to local entity 'nonconstval'
62
+
!PORTABILITY: specification expression refers to local object 'nonconstval' (initialized and saved)
63
63
type (derived(3, nonConstVal)) :: nonConstDerivedLen
64
64
!ERROR: 'colonderivedlen' has a type derived(typekind=3_4,typelen=:) with a deferred type parameter but is neither an allocatable nor an object pointer
0 commit comments