[flang-commits] [clang] [flang] [flang] Add checks for Fortran 2023 system clock and add f2023/f202Y to valid arguments of -std= (PR #205938)
Caroline Newcombe via flang-commits
flang-commits at lists.llvm.org
Wed Sep 23 05:46:08 PDT 2026
================
@@ -326,24 +326,26 @@ std::vector<const char *> LanguageFeatureControl::GetNames(
}
void LanguageFeatureControl::WarnOnAllNonstandard(bool yes) {
- warnAllLanguage_ = yes;
+ // This feature is set independently and is on by default:
+ bool clockStrict = warnUsage_.test(UsageWarning::SystemClockStrict);
+
warnLanguage_.reset();
if (yes) {
- disableAllWarnings_ = false;
warnLanguage_.flip();
// These three features do not need to be warned about,
// but we do want their feature flags.
warnLanguage_.set(LanguageFeature::OpenMP, false);
warnLanguage_.set(LanguageFeature::OpenACC, false);
warnLanguage_.set(LanguageFeature::CUDA, false);
}
+
+ // This feature is set independently and is on by default:
+ warnUsage_.set(UsageWarning::SystemClockStrict, clockStrict);
----------------
cenewcombe wrote:
Thanks, Chris. See my additional comment on CompilerInvocation.cpp — I suggested adding a test for `-std=f2018 -pedantic` to pin down whether `-pedantic` overrides the `-std=f2018` SYSTEM_CLOCK behavior. I don't feel strongly either way, but I think it has switched from what you had earlier, so the comment describing which flags override the warning may no longer be accurate. Let me know if I'm wrong here though!
https://github.com/llvm/llvm-project/pull/205938
More information about the flang-commits
mailing list