================ @@ -536,9 +536,34 @@ DiagnoseHLSLAvailability::FindAvailabilityAttr(const Decl *D) { void DiagnoseHLSLAvailability::CheckDeclAvailability(NamedDecl *D, const AvailabilityAttr *AA, SourceRange Range) { - if (ReportOnlyShaderStageIssues && !AA->getEnvironment()) - return; + IdentifierInfo *IIEnv = AA->getEnvironment(); + + if (!IIEnv) { + // The availability attribute does not have environment -> it depends only + // on shader model version and not on specific the shader stage. + + // Skip emitting the diagnostics if the diagnostic mode is not set to + // strict (-fhlsl-strict-availability) because all relevant diagnostics + // were already emitted in the DiagnoseUnguardedAvailability scan + // (SemaAvailability.cpp). + if (SemaRef.getLangOpts().HLSLStrictAvailability) + return; ---------------- damyanp wrote:
> Yes, it skips emitting diagnostic here in strict mode because it has already > been emitted in the... Right, but the comment says it skips emitting the diagnostics if it is _not_ in strict mode. https://github.com/llvm/llvm-project/pull/93860 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits