Skip to content

[flang] Adjust new warnings for extensions #94485

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions flang/lib/Semantics/check-declarations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -731,14 +731,13 @@ void CheckHelper::CheckObjectEntity(
}
} else if (!IsIntentInOut(symbol)) { // C1586
messages_.Say(
"non-POINTER dummy argument of pure %s must have INTENT() or VALUE attribute"_warn_en_US,
"non-POINTER dummy argument of pure %s must have INTENT() or VALUE attribute"_err_en_US,
what);
ok = false;
}
if (ok && InFunction()) {
if (ok && InFunction() && !InModuleFile() && !InElemental()) {
if (context_.IsEnabled(common::LanguageFeature::RelaxedPureDummy)) {
if (context_.ShouldWarn(common::LanguageFeature::RelaxedPureDummy) &&
!InModuleFile() && !InElemental()) {
if (context_.ShouldWarn(common::LanguageFeature::RelaxedPureDummy)) {
messages_.Say(
"non-POINTER dummy argument of pure function should be INTENT(IN) or VALUE"_warn_en_US);
}
Expand Down
4 changes: 2 additions & 2 deletions flang/test/Semantics/call10.f90
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pure real function f02(a)
real, value :: a ! ok
end function
pure real function f03(a) ! C1583
!ERROR: non-POINTER dummy argument of pure function must have INTENT() or VALUE attribute
!WARNING: non-POINTER dummy argument of pure function must have INTENT() or VALUE attribute
real :: a
end function
pure real function f03a(a)
Expand Down Expand Up @@ -83,7 +83,7 @@ pure function f08() ! C1585
end function

pure subroutine s01(a) ! C1586
!ERROR: non-POINTER dummy argument of pure subroutine must have INTENT() or VALUE attribute
!WARNING: non-POINTER dummy argument of pure subroutine must have INTENT() or VALUE attribute
real :: a
end subroutine
pure subroutine s01a(a)
Expand Down
Loading