summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
Commit message (Collapse)AuthorAgeFilesLines
...
* [Objective-C Sema] Patch to not issue unavailbility/deprecatedFariborz Jahanian2015-04-071-0/+19
| | | | | | | | warning when multiple method declarations are found in global pool with differing types and some are available. rdar://20408445 llvm-svn: 234328
* [Sema] Don't crash when __attribute__((nonnull)) is applied to blocksDavid Majnemer2015-04-071-0/+2
| | | | | | | | | A simple case of asserting isFunctionOrMethod when we should have asserted isFunctionOrMethodOrBlock. This fixes PR23117. llvm-svn: 234297
* [Objective-C patch]. Amend TransformObjCMessageExpr to handle callFariborz Jahanian2015-03-301-0/+23
| | | | | | | to 'super' of instance/class methods and not assert. rdar://20350364 llvm-svn: 233642
* [Objective-C diagnostic PATCH] Accept and ignore -Wreceiver-is-weakFariborz Jahanian2015-03-241-2/+3
| | | | | | | warning until Xcode removes the warning setting. rdar://20262140 llvm-svn: 233093
* Add -Wpartial-availability.Nico Weber2015-03-192-1/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* revert r231700 (designated initializer patch) which brokeFariborz Jahanian2015-03-111-41/+3
| | | | | | several projects. rdar://20120666. llvm-svn: 231939
* [Objective-C Sema]. Remove -Wreceiver-is-weak warning.Fariborz Jahanian2015-03-102-102/+2
| | | | | | | It is incorrect and better warning is issued under -Warc-repeated-use-of-weak. rdar://16316934. llvm-svn: 231851
* Recognize objc_bridge(id) on bridged casts to CF types.John McCall2015-03-101-0/+18
| | | | | | Fixes <rdar://20107345>. llvm-svn: 231814
* [PATCH Sema Objective-C]. Patch to warn on missing designated initializerFariborz Jahanian2015-03-091-3/+41
| | | | | | | override where at least a declaration of a designated initializer is in a super class and not necessarily in the current class. rdar://19653785. llvm-svn: 231700
* New ObjC warning: circular containers.Alex Denisov2015-03-041-0/+146
| | | | | | | | | | | | | | | | | | | | | This commit adds new warning to prevent user from creating 'circular containers'. Mutable collections from NSFoundation allows user to add collection to itself, e.g.: NSMutableArray *a = [NSMutableArray new]; [a addObject:a]; The code above leads to really weird behaviour (crashes, 'endless' recursion) and retain cycles (collection retains itself) if ARC enabled. Patch checks the following collections: - NSMutableArray, - NSMutableDictionary, - NSMutableSet, - NSMutableOrderedSet, - NSCountedSet. llvm-svn: 231265
* Update Clang tests to handle explicitly typed load changes in LLVM.David Blaikie2015-02-271-2/+2
| | | | llvm-svn: 230795
* Allow (Object *)kMyGlobalCFObj casts without bridgingBen Langmuir2015-02-252-10/+10
| | | | | | | | | | | | | | | | Previously we allowed these casts only for constants declared in system headers, which we assume are retain/release-neutral. Now also allow them for constants in user headers, treating them as +0. Practically, this means that we will now allow: id x = (id)kMyGlobalConst; But unlike with system headers we cannot mix them with +1 values: id y = (id)(b ? kMyGlobalConst : [Obj newValAtPlusOne]); // error id z = (id)(b ? kSystemGlobalConst: [Obj newValAtPlusOne]); // OK Thanks to John for suggesting this improvement. llvm-svn: 230534
* [Objective-C]. Provide a new formatting kind, "os_trace" whichFariborz Jahanian2015-02-211-0/+54
| | | | | | | can take a "const char*" format but supports standard printf and CF/NS types . rdar://19904147 llvm-svn: 230109
* [Objective-C Sema]. Don't warn about use of Fariborz Jahanian2015-02-191-0/+21
| | | | | | | property accessors in @selector not implemented because they will be auto-synthesized. rdar://16607480 llvm-svn: 229919
* Add more tests for NSArray/NSDictionary literalsAlex Denisov2015-02-172-0/+26
| | | | llvm-svn: 229470
* [Objctive-C sema]. Do not do the unused-getter-return-valueFariborz Jahanian2015-02-161-3/+27
| | | | | | | warning when property getter is used in direct method call and return value of property is unused. rdar://19773512 llvm-svn: 229458
* Fix crash when clang tries to build NSNumber literal after forward declarationAlex Denisov2015-02-161-0/+18
| | | | | | | | | | | Bug report: http://llvm.org/bugs/show_bug.cgi?id=22561 Clang tries to create ObjCBoxedExpression of type 'NSNumber' when 'NSNumber' has only forward declaration, this cause a crash later, when 'Sema' refers to a nil QualType of the whole expression. Please, refer to the bug report for the better explanation. llvm-svn: 229402
* Sema: Add support for __declspec(restrict)David Majnemer2015-02-041-5/+5
| | | | | | | | | | __declspec(restrict) and __attribute(malloc) are both handled identically by clang: they are allowed to the noalias LLVM attribute. Seeing as how noalias models the C99 notion of 'restrict', rename the internal clang attribute to Restrict from Malloc. llvm-svn: 228120
* Allow objc_bridge(id) to be used on typedefs of [cv] void*.John McCall2015-02-012-14/+24
| | | | | | rdar://19678874 llvm-svn: 227774
* Fix crashes on missing @interface for categoryBen Langmuir2015-01-202-0/+19
| | | | | | | In a few places we didn't check that Category->getClassInterface() was not null before using it. llvm-svn: 226605
* Patch fixes PR21932 crash on invalid code. UsingFariborz Jahanian2015-01-201-0/+6
| | | | | | | property-dot syntax on 'super' with no super class. Patch by Jason Haslam. llvm-svn: 226578
* Suggest objc_method_family(none) for a property named -newFoo or similar.Jordan Rose2015-01-161-6/+29
| | | | | | | | | | | | | | | As mentioned in the previous commit, if a property (declared with @property) has a name that matches a special Objective-C method family, the getter picks up that family despite being declared by the property. The most correct way to solve this problem is to add the 'objc_method_family' attribute to the getter with an argument of 'none', which unfortunately requires an explicit declaration of the getter. This commit adds a note to the existing error (ARC) or warning (MRR) for such a poorly-named property that suggests the solution; if there's already a declaration of the getter, it even includes a fix-it. llvm-svn: 226339
* Objective-C: Serialize "more than one decl" state of ObjCMethodList.Nico Weber2014-12-271-0/+23
| | | | | | | | | | | | | | | | | This fixes PR21587, what r221933 fixed for regular programs is now also fixed for decls coming from PCH files. Use another bit from the count/bits uint16_t for storing the "more than one decl" bit. This reduces the number of bits for the count from 14 to 13. The selector with the most overloads in Cocoa.h has ~55 overloads, so 13 bits should still be plenty. Since this changes the meaning of a serialized bit pattern, also increase clang::serialization::VERSION_MAJOR. Storing the "more than one decl" state of only the first overload isn't quite correct, but Sema::AreMultipleMethodsInGlobalPool() currently only looks at the state of the first overload so it's good enough for now. llvm-svn: 224892
* Objective-C: Tweak unavailability warning.Nico Weber2014-12-271-4/+17
| | | | | | | Don't warn when a selector has an unavailable and an available variant, and the first also has an implementation. llvm-svn: 224881
* Make the test from r224873 actually pass.Nico Weber2014-12-271-2/+4
| | | | | | | The behavior looks incorrect to me, but the test is supposed to document current behavior for now. llvm-svn: 224875
* Add more test coverage for the Objective-C deprected selector warning.Nico Weber2014-12-271-0/+11
| | | | | | | I broke this case in a local patch I'm writing, and there was no test to stop me. Now there is. llvm-svn: 224873
* Objective-C. Provide group name for warningFariborz Jahanian2014-12-181-0/+26
| | | | | | | on multiple selector names found during lookup. rdar://19265296 llvm-svn: 224536
* [Objective-C]. Modern property getters have side-effects.Fariborz Jahanian2014-12-181-0/+17
| | | | | | | | So, place warning about property getter should not be used for side-effect under its own group so warning can be turned off. rdar://19137815 llvm-svn: 224479
* [Objective-C]. This patch extends objc_bridge attribute to support ↵Fariborz Jahanian2014-12-111-0/+16
| | | | | | | | | | objc_bridge(id). This means that a pointer to the struct type to which the attribute appertains is a CF type (and therefore an Objective-C object of some type), but not of any specific class. rdar://19157264 llvm-svn: 224072
* Objective-C ARC. Fixes a crash when checking for 'weak' propery Fariborz Jahanian2014-11-211-0/+14
| | | | | | whose base is not an expression. rdar://19053620 llvm-svn: 222570
* Recommit r222044 with a test fix - it does not make sense to huntAnton Korobeynikov2014-11-141-1/+1
| | | | | | for a typedef before arithmetic conversion in all rare corner cases. llvm-svn: 222049
* Objective-C. Fixes a regression caused by implementationFariborz Jahanian2014-11-131-0/+20
| | | | | | | | of new warning for deprecated method call for receiver of type 'id'. This addresses rdar://18960378 where unintended warnings being issued. llvm-svn: 221933
* Temporary revert r221818 until all the problemsAnton Korobeynikov2014-11-121-1/+1
| | | | | | with objc stuff will be resolved. llvm-svn: 221829
* Update the tests to handle proper result type of (?:)Anton Korobeynikov2014-11-121-1/+1
| | | | llvm-svn: 221824
* Fixed a buildbot failure.Fariborz Jahanian2014-11-081-2/+2
| | | | llvm-svn: 221568
* [Objective-C Sema]. Issue availability/deprecated warning when Fariborz Jahanian2014-11-071-2/+12
| | | | | | | there is a uinque method found when message is sent to receiver of 'id' type. // rdar://18848183 llvm-svn: 221562
* Don't manually insert L prefixes.Rafael Espindola2014-11-061-1/+1
| | | | | | Simply marking the symbol private conveys the desire to hide them to LLVM. llvm-svn: 221451
* Patch for small addition to availability attribute.Fariborz Jahanian2014-11-051-0/+19
| | | | | | | | | This is to accept "NA" in place of vesion number for availability attribute. Used on introduced=NA to mean unavailable and deprecated=NA to mean nothing (not deprecated). rdar://18804883 llvm-svn: 221417
* Objective-C. revert patch for rdar://17554063.Fariborz Jahanian2014-10-282-17/+6
| | | | llvm-svn: 220812
* Actually remove this test entirely.Fariborz Jahanian2014-10-281-0/+0
| | | | llvm-svn: 220803
* [Objective-C]. revert r220740,r220727Fariborz Jahanian2014-10-281-41/+0
| | | | llvm-svn: 220802
* Improve on the diagnostic in my last patch and change warningFariborz Jahanian2014-10-271-1/+1
| | | | | | to error. rdar://18768214. llvm-svn: 220740
* Objective-C ARC [qoi]. Issue diagnostic if __bridge castingFariborz Jahanian2014-10-271-0/+41
| | | | | | to C type a collection literal. rdar://18768214 llvm-svn: 220727
* Objective-C [Sema]. Fixes a bug in comparing qualifiedFariborz Jahanian2014-10-132-5/+40
| | | | | | | | Objective-C pointer types. In this case, checker incorrectly claims incompatible pointer types if redundant protocol conformance is specified. rdar://18491222 llvm-svn: 219630
* Objective-C [qoi]. When reporting that a property is notFariborz Jahanian2014-10-105-8/+9
| | | | | | | | auto synthesized because it is synthesized in its super class. locate property declaration in super class which will default synthesize the property. rdar://18488727 llvm-svn: 219535
* Patch to wrap up '_' as separator in version numbersFariborz Jahanian2014-10-061-2/+2
| | | | | | | | | in availability attribute by preserving this info. in VersionTuple and using it in pretty printing of attributes and yet using '.' as separator when diagnosing unavailable message calls. rdar://18490958 llvm-svn: 219124
* Diagnose mixed use of '_' and '.' as versionFariborz Jahanian2014-10-021-0/+5
| | | | | | separators in my previous patch. llvm-svn: 218895
* Patch to accept '_' in addition to '.' as versionFariborz Jahanian2014-10-021-0/+92
| | | | | | | number separator in "availability" attribute. rdar://18490958 llvm-svn: 218884
* Objective-C. Under a special flag, -Wcstring-format-directive,Fariborz Jahanian2014-09-111-4/+23
| | | | | | | | | off by default, issue a warning if %s directive is used in formart argument of a function/method declared as __attribute__((format(CF/NSString, ...))) To complete rdar://18182443 llvm-svn: 217619
* More test for "void *" argument as index of a dictionary literal.Fariborz Jahanian2014-09-101-0/+5
| | | | llvm-svn: 217555
OpenPOWER on IntegriCloud