Add a fix-it for -Wunguarded-availability
authorAlex Lorenz <arphaman@gmail.com>
Fri, 5 May 2017 16:42:44 +0000 (16:42 +0000)
committerAlex Lorenz <arphaman@gmail.com>
Fri, 5 May 2017 16:42:44 +0000 (16:42 +0000)
commit9c5c2bfe54bd491ab6e0f7fb5a3dfe33675339ad
tree8c6c5a9f42cf99f06d52601a495509545a8ff6a1
parent841b0907c466634af0ed94a3a1a7954b50d0b3a5
Add a fix-it for -Wunguarded-availability

This patch adds a fix-it for the -Wunguarded-availability warning. This fix-it
is similar to the Swift one: it suggests that you wrap the statement in an
`if (@available)` check. The produced fixits are indented (just like the Swift
ones) to make them look nice in Xcode's fix-it preview.

rdar://31680358

Differential Revision: https://reviews.llvm.org/D32424

llvm-svn: 302253
clang/include/clang/Basic/DiagnosticSemaKinds.td
clang/include/clang/Lex/Lexer.h
clang/lib/Lex/Lexer.cpp
clang/lib/Sema/SemaDeclAttr.cpp
clang/test/FixIt/fixit-availability.c [new file with mode: 0644]
clang/test/FixIt/fixit-availability.mm [new file with mode: 0644]
clang/test/Sema/attr-availability.c