aboutsummaryrefslogtreecommitdiff
path: root/flang/lib/Semantics/pointer-assignment.cpp
diff options
context:
space:
mode:
authorPeter Klausler <35819229+klausler@users.noreply.github.com>2023-11-13 16:13:50 -0800
committerGitHub <noreply@github.com>2023-11-13 16:13:50 -0800
commit1c91d9bdea3b6c38e8fbce46ec8181a9c0aa26f8 (patch)
treecf9c2d958a333e7dbbe60c600a5ad025ce41b049 /flang/lib/Semantics/pointer-assignment.cpp
parenta5eb6bdd8e126ad94de0a12002cac2c3f01e05f5 (diff)
downloadllvm-1c91d9bdea3b6c38e8fbce46ec8181a9c0aa26f8.zip
llvm-1c91d9bdea3b6c38e8fbce46ec8181a9c0aa26f8.tar.gz
llvm-1c91d9bdea3b6c38e8fbce46ec8181a9c0aa26f8.tar.bz2
[flang] Ensure that portability warnings are conditional (#71857)
Before emitting a warning message, code should check that the usage in question should be diagnosed by calling ShouldWarn(). A fair number of sites in the code do not, and can emit portability warnings unconditionally, which can confuse a user that hasn't asked for them (-pedantic) and isn't terribly concerned about portability *to* other compilers. Add calls to ShouldWarn() or IsEnabled() around messages that need them, and add -pedantic to tests that now require it to test their portability messages, and add more expected message lines to those tests when -pedantic causes other diagnostics to fire.
Diffstat (limited to 'flang/lib/Semantics/pointer-assignment.cpp')
-rw-r--r--flang/lib/Semantics/pointer-assignment.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/flang/lib/Semantics/pointer-assignment.cpp b/flang/lib/Semantics/pointer-assignment.cpp
index 1343484..0dcaa4e 100644
--- a/flang/lib/Semantics/pointer-assignment.cpp
+++ b/flang/lib/Semantics/pointer-assignment.cpp
@@ -380,7 +380,7 @@ bool PointerAssignmentChecker::Check(const evaluate::ProcedureDesignator &d) {
return false;
}
} else if (symbol->has<ProcBindingDetails>() &&
- context_.ShouldWarn(common::UsageWarning::Portability)) {
+ context_.ShouldWarn(common::LanguageFeature::BindingAsProcedure)) {
evaluate::SayWithDeclaration(foldingContext_.messages(), *symbol,
"Procedure binding '%s' used as target of a pointer assignment"_port_en_US,
symbol->name());