[PATCH] D25284: AvailabilityAttrs: Delay partial availability diagnostics

Erik Pilkington via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 5 10:04:31 PDT 2016


erik.pilkington created this revision.
erik.pilkington added a reviewer: manmanren.
erik.pilkington added a subscriber: cfe-commits.

Note: this patch depends on: https://reviews.llvm.org/D25283

This patch delays handling of `AR_NotYetIntroduced` diagnostics, so that the following compiles with no warnings:

  typedef int new_int __attribute__((availability(macos, introduced=100)));
  
  new_int f() __attribute__((availability(macos, introduced=100)));

This is done by treating `AR_NotYetIntroduced` diagnostics as delayed, just like `AR_Unavailable` and `AR_Deprecated`. This means that we emit the diagnostic once we finished parsing `f()`, at which point we have the context to determine if we should diagnose `new_int`.

Thanks!


https://reviews.llvm.org/D25284

Files:
  include/clang/Sema/DelayedDiagnostic.h
  lib/Sema/DelayedDiagnostic.cpp
  lib/Sema/SemaDeclAttr.cpp
  test/SemaObjC/unguarded-availability.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25284.73662.patch
Type: text/x-patch
Size: 6865 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161005/561db758/attachment-0001.bin>


More information about the cfe-commits mailing list