diff options
Diffstat (limited to 'flang/lib/Semantics/check-allocate.cpp')
-rw-r--r-- | flang/lib/Semantics/check-allocate.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/flang/lib/Semantics/check-allocate.cpp b/flang/lib/Semantics/check-allocate.cpp index 1e54123..223bee6 100644 --- a/flang/lib/Semantics/check-allocate.cpp +++ b/flang/lib/Semantics/check-allocate.cpp @@ -616,9 +616,11 @@ bool AllocationCheckerHelper::RunChecks(SemanticsContext &context) { } if (allocateInfo_.gotPinned) { std::optional<common::CUDADataAttr> cudaAttr{GetCUDADataAttr(ultimate_)}; - if (!cudaAttr || *cudaAttr != common::CUDADataAttr::Pinned) { + if ((!cudaAttr || *cudaAttr != common::CUDADataAttr::Pinned) && + context.languageFeatures().ShouldWarn( + common::UsageWarning::CUDAUsage)) { context.Say(name_.source, - "Object in ALLOCATE must have PINNED attribute when PINNED option is specified"_err_en_US); + "Object in ALLOCATE should have PINNED attribute when PINNED option is specified"_warn_en_US); } } if (allocateInfo_.gotStream) { |