@@ -1187,6 +1187,7 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
1187
1187
llvm::Triple t (res.getTargetOpts ().triple );
1188
1188
1189
1189
constexpr unsigned newestFullySupported = 31 ;
1190
+ constexpr unsigned latestFinalized = 60 ;
1190
1191
// By default OpenMP is set to the most recent fully supported version
1191
1192
res.getLangOpts ().OpenMPVersion = newestFullySupported;
1192
1193
res.getFrontendOpts ().features .Enable (
@@ -1209,12 +1210,26 @@ static bool parseOpenMPArgs(CompilerInvocation &res, llvm::opt::ArgList &args,
1209
1210
diags.Report (diagID) << value << arg->getAsString (args) << versions.str ();
1210
1211
};
1211
1212
1213
+ auto reportFutureVersion = [&](llvm::StringRef value) {
1214
+ const unsigned diagID = diags.getCustomDiagID (
1215
+ clang::DiagnosticsEngine::Warning,
1216
+ " The specification for OpenMP version %0 is still under development; "
1217
+ " the syntax and semantics of new features may be subject to change" );
1218
+ std::string buffer;
1219
+ llvm::raw_string_ostream versions (buffer);
1220
+ llvm::interleaveComma (ompVersions, versions);
1221
+
1222
+ diags.Report (diagID) << value;
1223
+ };
1224
+
1212
1225
llvm::StringRef value = arg->getValue ();
1213
1226
if (!value.getAsInteger (/* radix=*/ 10 , version)) {
1214
1227
if (llvm::is_contained (ompVersions, version)) {
1215
1228
res.getLangOpts ().OpenMPVersion = version;
1216
1229
1217
- if (version > newestFullySupported)
1230
+ if (version > latestFinalized)
1231
+ reportFutureVersion (value);
1232
+ else if (version > newestFullySupported)
1218
1233
diags.Report (clang::diag::warn_openmp_incomplete) << version;
1219
1234
} else if (llvm::is_contained (oldVersions, version)) {
1220
1235
const unsigned diagID =
0 commit comments