erik.pilkington added inline comments.

================
Comment at: test/CodeGenObjC/availability-check.m:16
+  // CHECK: br i1 true
+  if (__builtin_available(ios 10, *))
+    ;
----------------
arphaman wrote:
> Shouldn't this be `br i1 false`, since we are building for macOS so we have 
> no iOS support at all?
No, this is intentional. If the platform we're targeting isn't mentioned, we 
take the `*` case, and emit -Wunguarded-availability diagnostics in the body of 
the `if` using the minimum deployment target. The idea is that if a new OS is 
released it will be forked from an existing one and use existing APIs, and it 
would be unfortunate for everyone to have to add the new platform to their 
existing `@available` calls. This is probably the most counterintuative part of 
this feature, and is the reason for the somewhat bizarre `*` syntax, to call 
out this control flow.


https://reviews.llvm.org/D27827



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to