From cc1eae6ea2de5ccadb81a182b9f0de2128b9fefc Mon Sep 17 00:00:00 2001 From: Tom Eccles Date: Thu, 26 Jun 2025 14:09:21 +0100 Subject: [flang][OpenMP] Remove experimental warning (#144915) RFC: https://discourse.llvm.org/t/rfc-removing-the-openmp-experimental-warning-for-llvm-21/86455 Fixes: #110008 --- flang/lib/Frontend/CompilerInvocation.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'flang/lib/Frontend/CompilerInvocation.cpp') diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp index 07d6814..766131f 100644 --- a/flang/lib/Frontend/CompilerInvocation.cpp +++ b/flang/lib/Frontend/CompilerInvocation.cpp @@ -1138,8 +1138,9 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args, unsigned numErrorsBefore = diags.getNumErrors(); llvm::Triple t(res.getTargetOpts().triple); - // By default OpenMP is set to 3.1 version - res.getLangOpts().OpenMPVersion = 31; + constexpr unsigned newestFullySupported = 31; + // By default OpenMP is set to the most recent fully supported version + res.getLangOpts().OpenMPVersion = newestFullySupported; res.getFrontendOpts().features.Enable( Fortran::common::LanguageFeature::OpenMP); if (auto *arg = @@ -1164,6 +1165,9 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args, if (!value.getAsInteger(/*radix=*/10, version)) { if (llvm::is_contained(ompVersions, version)) { res.getLangOpts().OpenMPVersion = version; + + if (version > newestFullySupported) + diags.Report(clang::diag::warn_openmp_incomplete) << version; } else if (llvm::is_contained(oldVersions, version)) { const unsigned diagID = diags.getCustomDiagID(clang::DiagnosticsEngine::Warning, -- cgit v1.1