We should warn about uses of @available in all places except for if (@available(...)) because we only support the guarded availability checking using if (@available(...)).
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/clang/Basic/DiagnosticSemaKinds.td | ||
---|---|---|
2889 ↗ | (On Diff #99948) | Might be a bit more clear if you mention in words that @available can only be the sole condition to the if? This is probably fine though. |
lib/Sema/SemaExpr.cpp | ||
15747 ↗ | (On Diff #99948) | I believe this will not be set if we're rebuilding a templated function, we should also flag this from TransformObjCAvailabilityCheckExpr in TreeTransform.h. |
Comment Actions
LGTM, thanks!
lib/Sema/SemaExpr.cpp | ||
---|---|---|
15747 ↗ | (On Diff #99948) | On second thought, there is no point in doing that because we'd have already emitted a diagnostic from the pattern. This is correct as is. |