================
@@ -1197,22 +1194,66 @@ static bool parseDialectArgs(CompilerInvocation &res, 
llvm::opt::ArgList &args,
         Fortran::common::LanguageFeature::OpenACC);
   }
 
-  // -std=f2018
-  // TODO: Set proper options when more fortran standards
-  // are supported.
+  // -std=f20**
   if (args.hasArg(clang::options::OPT_std_EQ)) {
     auto standard = args.getLastArgValue(clang::options::OPT_std_EQ);
-    // We only allow f2018 as the given standard
     if (standard == "f2018") {
-      res.setEnableConformanceChecks();
       res.getFrontendOpts().features.WarnOnAllNonstandard();
+      res.getLangOpts().setFortranStandard(
+          Fortran::common::LangOptions::Fortran2018);
+    } else if (standard == "f2023") {
+      res.getFrontendOpts().features.WarnOnAllNonstandard();
+      res.getLangOpts().setFortranStandard(
+          Fortran::common::LangOptions::Fortran2023);
+    } else if (standard == "f202Y") {
+      res.getFrontendOpts().features.WarnOnAllNonstandard();
+      res.getLangOpts().setFortranStandard(
+          Fortran::common::LangOptions::Fortran202Y);
     } else {
       const unsigned diagID =
           diags.getCustomDiagID(clang::DiagnosticsEngine::Error,
-                                "Only -std=f2018 is allowed currently.");
+                                "Only 'f2018', 'f2023', or 'f202Y' are "
+                                "accepted to -std= currently.");
       diags.Report(diagID);
     }
   }
+
+  // -f{no-}system-clock-strict
----------------
chris-earl wrote:

I put this logic here so that it would be certain to happen after the `std` 
flag is parsed (if present), which is just above this. If there is a better 
place to put this after the `std` flag is parsed, I'm happy to move it.

Also, the logic of `frealloc-lhs`, a driver-visible flag, is also handled in 
this file (in `createFromArgs()`).

https://github.com/llvm/llvm-project/pull/205938
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to