From 4d621025d4fc2f2438affdca7a016dd93b56f4e0 Mon Sep 17 00:00:00 2001 From: Chris B Date: Fri, 20 Sep 2024 16:41:15 -0500 Subject: [HLSL] Warn about incomplete language support (#108894) This adds a warning about incomplete language mode support before HLSL 202x. This is the last change in the sequence to fix and make HLSL 202x the default mode for Clang (#108044). Fixes #108044 --- clang/lib/Frontend/CompilerInvocation.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'clang/lib/Frontend/CompilerInvocation.cpp') diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index de6776b..efd8525 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -4484,6 +4484,15 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, } } else Diags.Report(diag::err_drv_hlsl_unsupported_target) << T.str(); + + if (Opts.LangStd < LangStandard::lang_hlsl202x) { + const LangStandard &Requested = + LangStandard::getLangStandardForKind(Opts.LangStd); + const LangStandard &Recommended = + LangStandard::getLangStandardForKind(LangStandard::lang_hlsl202x); + Diags.Report(diag::warn_hlsl_langstd_minimal) + << Requested.getName() << Recommended.getName(); + } } return Diags.getNumErrors() == NumErrorsBefore; -- cgit v1.1