[clang] [Clang][HLSL] Add environment parameter to availability attribute (PR #89809)

Helena Kotas via cfe-commits cfe-commits at lists.llvm.org
Tue May 7 16:03:53 PDT 2024


================
@@ -3859,7 +3862,7 @@ def warn_availability_fuchsia_unavailable_minor : Warning<
   InGroup<Availability>;
 
 def warn_unguarded_availability :
-  Warning<"%0 is only available on %1 %2 or newer">,
+  Warning<"%0 %select{is only|is not}5 available %select{|in %4 environment }3on %1 %2 %select{or newer|}5">,
----------------
hekota wrote:

I have modified the diagnostic message when the API is not available in the target environment for any version to say that it is unavailable and added a note with additional information like this:

```
warning: 'A' is unavailable
note: 'A' has been marked as being introduced in %attr-platform %attr-version %attr-env environment here, but the deployment target is %target-platform %target -version %target-env environment.
```

https://github.com/llvm/llvm-project/pull/89809


More information about the cfe-commits mailing list