summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/DelayedDiagnostic.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove trailing spaceFangrui Song2018-07-301-2/+2
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* [Sema] Make deprecation fix-it replace all multi-parameter ObjC method slots.Volodymyr Sapsai2018-03-291-3/+10
| | | | | | | | | | | | | | | | | | Deprecation replacement can be any text but if it looks like a name of ObjC method and has the same number of arguments as original method, replace all slot names so after applying a fix-it you have valid code. rdar://problem/36660853 Reviewers: aaron.ballman, erik.pilkington, rsmith Reviewed By: erik.pilkington Subscribers: cfe-commits, jkorous-apple Differential Revision: https://reviews.llvm.org/D44589 llvm-svn: 328807
* [Sema] Fix some Clang-tidy modernize and Include What You Use warnings; ↵Eugene Zelenko2018-02-211-3/+5
| | | | | | other minor fixes (NFC). llvm-svn: 325659
* [Sema] Don't allow -Wunguarded-availability to be silenced with redeclsErik Pilkington2017-07-051-2/+4
| | | | | | Differential revision: https://reviews.llvm.org/D33816 llvm-svn: 307175
* [Sema] Delay partial availability diagnostics, just like deprecatedErik Pilkington2016-10-281-21/+12
| | | | | | | | | This is done so that the following compiles with no warnings: int fn(type_10_12) __attribute__((availability(macos, introduced=10.12))); Differential revision: https://reviews.llvm.org/D25284 llvm-svn: 285457
* [NFC][ObjC Availability] Refactor DiagnoseAvailabilityOfDeclErik Pilkington2016-08-051-9/+9
| | | | | | Differential revision: https://reviews.llvm.org/D23221 llvm-svn: 277887
* Addressing review comments for r261163.Manman Ren2016-02-221-4/+0
| | | | | | | | | Use "strict" instead of "nopartial". Also make strictly not-introduced share the same diagnostics as Obsolete and Unavailable. rdar://23791325 llvm-svn: 261512
* Add 'nopartial' qualifier for availability attributes.Manman Ren2016-02-171-0/+4
| | | | | | | | | | | | | | | | | | | | | | An optional nopartial can be placed after the platform name. int bar() __attribute__((availability(macosx,nopartial,introduced=10.12)) When deploying back to a platform version prior to when the declaration was introduced, with 'nopartial', Clang emits an error specifying that the function is not introduced yet; without 'nopartial', the behavior stays the same: the declaration is `weakly linked`. A member is added to the end of AttributeList to save the location of the 'nopartial' keyword. A bool member is added to AvailabilityAttr. The diagnostics for 'nopartial' not-yet-introduced is handled in the same way as we handle unavailable cases. Reviewed by Doug Gregor and Jordan Rose. rdar://23791325 llvm-svn: 261163
* Add -Wpartial-availability.Nico Weber2015-03-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This warns when using decls that are not available on all deployment targets. For example, a call to - (void)ppartialMethod __attribute__((availability(macosx,introduced=10.8))); will warn if -mmacosx-version-min is set to less than 10.8. To silence the warning, one has to explicitly redeclare the method like so: @interface Whatever(MountainLionAPI) - (void)ppartialMethod; @end This way, one cannot accidentally call a function that isn't available everywhere. Having to add the redeclaration will hopefully remind the user to add an explicit respondsToSelector: call as well. Some projects build against old SDKs to get this effect, but building against old SDKs suppresses some bug fixes -- see http://crbug.com/463171 for examples. The hope is that SDK headers are annotated well enough with availability attributes that new SDK + this warning offers the same amount of protection as using an old SDK. llvm-svn: 232750
* Objective-C. Diagnose when property access is using declaredFariborz Jahanian2014-06-161-1/+3
| | | | | | | property accessor methods which have become deprecated or available. // rdar://15951801 llvm-svn: 211039
* [C++11] Use 'nullptr'. Sema edition.Craig Topper2014-05-261-1/+1
| | | | llvm-svn: 209613
* Squelch leak found by LSan by handling missing switch case.Jordan Rose2014-04-241-2/+3
| | | | | | | | Also, use the enum type in the switch so this doesn't happen again. PR19523 llvm-svn: 207128
* Implemented delayed processing of 'unavailable' checking, just like with ↵Ted Kremenek2013-12-181-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | 'deprecated'. Fixes <rdar://problem/15584219> and <rdar://problem/12241361>. This change looks large, but all it does is reuse and consolidate the delayed diagnostic logic for deprecation warnings with unavailability warnings. By doing so, it showed various inconsistencies between the diagnostics, which were close, but not consistent. It also revealed some missing "note:"'s in the deprecated diagnostics that were showing up in the unavailable diagnostics, etc. This change also changes the wording of the core deprecation diagnostics. Instead of saying "function has been explicitly marked deprecated" we now saw "'X' has been been explicitly marked deprecated". It turns out providing a bit more context is useful, and often we got the actual term wrong or it was not very precise (e.g., "function" instead of "destructor"). By just saying the name of the thing that is deprecated/deleted/unavailable we define this issue away. This diagnostic can likely be further wordsmithed to be shorter. llvm-svn: 197627
* objective-C: when diagnosing deprecated/unavailable usage ofFariborz Jahanian2012-09-211-0/+2
| | | | | | | setter or getter backing a deprecated/unavailable property, also not location of the property. // rdar://12324295 llvm-svn: 164412
* objc: When issue diagnostic about deprecated method, alsoFariborz Jahanian2012-03-021-2/+4
| | | | | | | issue the note if it is because message is sent to a forward class declaration in delayed diagnostic. // rdar://10290322 llvm-svn: 151942
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-1/+1
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* Automatic Reference Counting.John McCall2011-06-151-0/+3
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Teach DelayedDiagnostic to copy its string, rather than hope that theDouglas Gregor2011-03-231-0/+51
string itself lives longer than the DelayedDiagnostic. Fixes a recent use-after-free regression due to my availability attribute work. llvm-svn: 128148
OpenPOWER on IntegriCloud