File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -730,15 +730,26 @@ void CheckHelper::CheckObjectEntity(
730
730
}
731
731
}
732
732
} else if (!IsIntentInOut (symbol)) { // C1586
733
- messages_.Say (
734
- " non-POINTER dummy argument of pure %s must have INTENT() or VALUE attribute" _warn_en_US,
735
- what);
733
+ if (!InModuleFile ()) {
734
+ if (context_.IsEnabled (common::LanguageFeature::RelaxedPureDummy)) {
735
+ if (context_.ShouldWarn (
736
+ common::LanguageFeature::RelaxedPureDummy)) {
737
+ messages_.Say (
738
+ " non-POINTER dummy argument of pure %s should have INTENT() or VALUE attribute" _warn_en_US,
739
+ what);
740
+ }
741
+ } else {
742
+ messages_.Say (
743
+ " non-POINTER dummy argument of pure %s must have INTENT() or VALUE attribute" _err_en_US,
744
+ what);
745
+ }
746
+ }
736
747
ok = false ;
737
748
}
738
- if (ok && InFunction ()) {
749
+ if (ok && InFunction () && ! InModuleFile () ) {
739
750
if (context_.IsEnabled (common::LanguageFeature::RelaxedPureDummy)) {
740
751
if (context_.ShouldWarn (common::LanguageFeature::RelaxedPureDummy) &&
741
- !InModuleFile () && ! InElemental ()) {
752
+ !InElemental ()) {
742
753
messages_.Say (
743
754
" non-POINTER dummy argument of pure function should be INTENT(IN) or VALUE" _warn_en_US);
744
755
}
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ pure real function f02(a)
53
53
real , value :: a ! ok
54
54
end function
55
55
pure real function f03(a) ! C1583
56
- ! ERROR : non-POINTER dummy argument of pure function must have INTENT() or VALUE attribute
56
+ ! WARNING : non-POINTER dummy argument of pure function should have INTENT() or VALUE attribute
57
57
real :: a
58
58
end function
59
59
pure real function f03a(a)
@@ -83,7 +83,7 @@ pure function f08() ! C1585
83
83
end function
84
84
85
85
pure subroutine s01 (a ) ! C1586
86
- ! ERROR : non-POINTER dummy argument of pure subroutine must have INTENT() or VALUE attribute
86
+ ! WARNING : non-POINTER dummy argument of pure subroutine should have INTENT() or VALUE attribute
87
87
real :: a
88
88
end subroutine
89
89
pure subroutine s01a (a )
You can’t perform that action at this time.
0 commit comments