File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -1558,8 +1558,9 @@ bool IsAutomaticallyDestroyed(const Symbol &symbol) {
1558
1558
return symbol.has <ObjectEntityDetails>() &&
1559
1559
(symbol.owner ().kind () == Scope::Kind::Subprogram ||
1560
1560
symbol.owner ().kind () == Scope::Kind::BlockConstruct) &&
1561
- (!IsDummy (symbol) || IsIntentOut (symbol)) && !IsPointer (symbol) &&
1562
- !IsSaved (symbol) && !FindCommonBlockContaining (symbol);
1561
+ !IsNamedConstant (symbol) && (!IsDummy (symbol) || IsIntentOut (symbol)) &&
1562
+ !IsPointer (symbol) && !IsSaved (symbol) &&
1563
+ !FindCommonBlockContaining (symbol);
1563
1564
}
1564
1565
1565
1566
const std::optional<parser::Name> &MaybeGetNodeName (
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ pure subroutine test
29
29
type (t1) x1
30
30
! WARNING: 'x1a' of derived type 't1' does not have a FINAL subroutine for its rank (1)
31
31
type (t1), allocatable :: x1a(:)
32
+ type (t1), parameter :: namedConst = t1() ! ok
32
33
! ERROR: 'x2' may not be a local variable in a pure subprogram
33
34
! BECAUSE: 'x2' has an impure FINAL procedure 'final'
34
35
type (t2) x2
You can’t perform that action at this time.
0 commit comments