summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
Commit message (Collapse)AuthorAgeFilesLines
* Add a clarifying note when a return statement is rejected becauseJohn McCall2013-03-192-7/+33
| | | | | | | | we expect a related result type. rdar://12493140 llvm-svn: 177378
* Remove -Wspellcheck and replace it with a diagnostic option.Argyrios Kyrtzidis2013-03-161-1/+1
| | | | | | | Thanks to Richard S. for pointing out that the warning would show up with -Weverything. llvm-svn: 177218
* Don't try to typo-correct 'super' in an objc method.Argyrios Kyrtzidis2013-03-141-0/+21
| | | | | | | | | | | | | | | | | | | | | This created 2 issues: 1) Performance issue, since typo-correction with PCH/modules is rather expensive. 2) Correctness issue, since if it managed to "correct" 'super' then bogus compiler errors would be emitted, like this: 3.m:8:3: error: unknown type name 'super'; did you mean 'super1'? super.x = 0; ^~~~~ super1 t3.m:5:13: note: 'super1' declared here typedef int super1; ^ t3.m:8:8: error: expected identifier or '(' super.x = 0; ^ llvm-svn: 177126
* Objective-C: In my last path, also checkFariborz Jahanian2013-03-121-0/+11
| | | | | | | | for existence of user setter before issuing the warning about non-synthesizable property. // rdar://13388503 llvm-svn: 176906
* Objective-C: Issue warning in couple of obscure casesFariborz Jahanian2013-03-121-0/+30
| | | | | | | | | | when property autosynthesis does not synthesize a property. When property is declared 'readonly' in a super class and is redeclared 'readwrite' in a subclass. When a property autosynthesis causes it to share 'ivar' with another property. // rdar://13388503 llvm-svn: 176889
* Modify comment in user test.Fariborz Jahanian2013-03-121-1/+1
| | | | llvm-svn: 176870
* Objective-C: When using super.prop, property should beFariborz Jahanian2013-03-111-2/+23
| | | | | | | looked up the current class's super class. // rdar://13349296 llvm-svn: 176832
* Adjust the special non-C++ enum block return type inferenceJohn McCall2013-03-091-4/+16
| | | | | | | | | | | | | | | so that it looks through certain syntactic forms and applies even if normal inference would have succeeded. There is potential for source incompatibility from this change, but overall we feel that it produces a much cleaner and more defensible result, and the block compatibility rules should curb a lot of the potential for annoyance. rdar://13200889 llvm-svn: 176743
* Improve LLDB's implicit cast-to-id to work with C++11 auto and any ↵Douglas Gregor2013-03-071-0/+2
| | | | | | Objective-C object type <rdar://problem/13338107>. llvm-svn: 176665
* objective-C: don't crash after diagnosingFariborz Jahanian2013-03-061-0/+17
| | | | | | | using object subscripting without declaring objectForKeyedSubscript: // rdar://13333205 llvm-svn: 176539
* Perform the receiver-expression transformations regardless ofJohn McCall2013-03-014-10/+6
| | | | | | | | | | | | | | whether we already have a method. Fixes a bug where we were failing to properly contextually convert a message receiver during template instantiation. As a side-effect, we now actually perform correct method lookup after adjusting a message-send to integral or non-ObjC pointer types (legal outside of ARC). rdar://13305374 llvm-svn: 176339
* Attempt to not place ownership qualifiers on the result typeJohn McCall2013-03-011-3/+42
| | | | | | | | | | | of block declarators. Document the rule we use. Also document the rule that Doug implemented a few weeks ago which drops ownership qualifiers on function result types. rdar://10127067 llvm-svn: 176336
* Fix warning text of my last patch.Fariborz Jahanian2013-02-281-3/+3
| | | | | | // rdar://13158394 llvm-svn: 176308
* objective-C: clang, following gcc, warns onFariborz Jahanian2013-02-281-3/+3
| | | | | | | | use of stand-alone protocol as type and uses id<proto>. Modify warning to say what compiler is doing. // rdar//13158394 llvm-svn: 176303
* In LookupResult::resolveKind(), when handling multiple found declarations, ↵Argyrios Kyrtzidis2013-02-221-5/+4
| | | | | | | | | ignore invalid declarations. This reduces the "ambiguous reference" errors (which are rather strange in C/ObjC) and fixes an assertion hit with an invalid code test case. llvm-svn: 175869
* Test for my last patch. // rdar://13178483Fariborz Jahanian2013-02-181-0/+29
| | | | llvm-svn: 175453
* Fix crash-on-invalid where a ParenListExpr shows up as a message receiverArgyrios Kyrtzidis2013-02-151-0/+8
| | | | | | | | while trying to do error recovery. rdar://13207886 llvm-svn: 175282
* Sema: Unnest early exit and remove an unnecessary bad cast.Benjamin Kramer2013-02-151-0/+3
| | | | | | | cast<ObjCObjectPointerType> doesn't look through sugar, getAs does. Fixes PR15257. llvm-svn: 175272
* objective-C: When implementing custom accessor method forFariborz Jahanian2013-02-141-1/+23
| | | | | | | | a property, the -Wdirect-ivar-access should not warn when accessing the property's synthesized instance variable. // rdar://13142820 llvm-svn: 175195
* Perform placeholder conversions on the controller of a _GenericJohn McCall2013-02-121-0/+17
| | | | | | expression. llvm-svn: 174930
* objective-C: Fixes a bogus warning due to not settingFariborz Jahanian2013-02-103-3/+22
| | | | | | | | the "nonatomic" attribute in property redeclaration in class extension. Also, improved on diagnostics in this area while at it. // rdar://13156292 llvm-svn: 174821
* QoI: -Wreadonly-iboutlet-property should have the warning's location on the ↵Ted Kremenek2013-02-091-8/+6
| | | | | | | | | | property. There's no need to refer to the @implementation at all. Fixes <rdar://problem/13186515> llvm-svn: 174802
* objective-C: don't issue bogus warning aboutFariborz Jahanian2013-02-081-0/+21
| | | | | | | | "auto-synthesized may not work correctly with 'nib' loader" when 'readonly' property is redeclared 'readwrite' in class extension. // rdar://13123861 llvm-svn: 174775
* Undo my re-wording of the "ARC forbids Objective-C objects in ..."Douglas Gregor2013-01-281-4/+4
| | | | | | error. Jordan is right. llvm-svn: 173713
* Forbid the use of objects in unions in Objective-C++ ARC. FixesDouglas Gregor2013-01-281-4/+4
| | | | | | <rdar://problem/13098104>. llvm-svn: 173708
* objectiveC (take two): don't warn when in -Wselector mode andFariborz Jahanian2013-01-221-0/+3
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173179
* objectiveC: don't warn when in -Wselector mode andFariborz Jahanian2013-01-211-0/+26
| | | | | | | an unimplemented selector is consumed by "respondsToSelector:". // rdar://12938616 llvm-svn: 173097
* When checking the parameter types of an Objective-C method, don'tDouglas Gregor2013-01-181-1/+5
| | | | | | | decay the parameter type immediately; let CheckParameter() do its job. Fixes <rdar://problem/12071218>. llvm-svn: 172780
* In Objective-C ARC, completely ignore ownership qualifiers on theDouglas Gregor2013-01-171-0/+19
| | | | | | | | return type of a function by canonicalizing them away. They are useless anyway, and conflict with our rules for template argument deduction and __strong. Fixes <rdar://problem/12367446>. llvm-svn: 172768
* One can have an unavailable method overridden by an available method,Douglas Gregor2013-01-161-4/+4
| | | | | | | but not vice-versa. Fix bug introduced in r172567 and noticed by Jordan, thanks! llvm-svn: 172586
* When checking availability attributes for consistency between anDouglas Gregor2013-01-151-0/+13
| | | | | | | | overriding and overridden method, allow the overridden method to have a narrower contract (introduced earlier, deprecated/obsoleted later) than the overriding method. Fixes <rdar://problem/12992023>. llvm-svn: 172567
* Use Decl::getAvailability() rather than checking for the "unavailable"Douglas Gregor2013-01-081-1/+3
| | | | | | | attribute when determining whether we need to see an implementation of a property. Fixes <rdar://problem/12958191>. llvm-svn: 171877
* objective-C: when searching for declarations in protocolFariborz Jahanian2013-01-071-0/+21
| | | | | | | list of classes, etc., make sure to look into protocol definitions. // rdar://12958878 llvm-svn: 171777
* Fix up various builtin declaration of objc_msgSend familiesFariborz Jahanian2013-01-042-1/+17
| | | | | | | to match those foung in objc.h an avoid spurious warnings. // rdar://12489098 llvm-svn: 171492
* Fix capitalization of Objective-C in diagnostic.Ted Kremenek2013-01-031-6/+6
| | | | llvm-svn: 171440
* Simplify RUN lines. No functionality change.Nick Lewycky2012-12-241-2/+2
| | | | llvm-svn: 171045
* Change checkUnsafeAssignLiteral() to use the new Sema::CheckLiteralKind().Ted Kremenek2012-12-211-2/+6
| | | | | | | | | | Along the way, fix a bug in CheckLiteralKind(), previously in diagnoseObjCLiteralComparison, where we didn't ignore parentheses in boxed expressions for purpose of classification. In other words, both @42 and @(42) should be classified as numeric literals. llvm-svn: 170931
* Extend checkUnsafeAssigns() to also handle assigning an object literal to a ↵Ted Kremenek2012-12-212-6/+68
| | | | | | | | | | weak reference. Thanks to Jordan Rose and John McCall for their sage code review. Fixes <rdar://problem/12569201>. llvm-svn: 170864
* Revert "Warn if a __weak variable is initialized with an Objective-C object ↵Ted Kremenek2012-12-201-24/+0
| | | | | | | | literal." Per code feedback, I want to see if there is a more general way to do this. llvm-svn: 170777
* Warn if a __weak variable is initialized with an Objective-C object literal.Ted Kremenek2012-12-201-0/+24
| | | | | | | | | Such variables may immediately become nil or may have unpredictable behavior. Fixes <rdar://problem/12569201>. llvm-svn: 170763
* objective-C: Don't warn of unimplemented property of protocols in Fariborz Jahanian2012-12-191-0/+29
| | | | | | | category, when those properties will be implemented in category's primary class or one of its super classes. // rdar://12568064 llvm-svn: 170573
* The underlying type for an enum should be an integer type, not another enum.Eli Friedman2012-12-181-1/+3
| | | | | | | | (This change only affects ObjC.) <rdar://problem/12857117>. llvm-svn: 170402
* objc: DOn't complain if a (SEL) expression is typecastFariborz Jahanian2012-12-131-0/+3
| | | | | | to (SEL). Fixes // rdar://12859590 llvm-svn: 170058
* [objc] For the ARC error that is emitted when a synthesized property ↵Argyrios Kyrtzidis2012-12-124-31/+40
| | | | | | | | | | | | | | | implementation has inconsistent ownership with the backing ivar, point the error location to the ivar. Pointing to the ivar (instead of the @synthesize) is better since this is where a fix is needed. Also provide the location of @synthesize via a note. This also fixes the problem where an auto-synthesized property would emit an error without any location. llvm-svn: 170039
* Don't complain about incomplete implementations for methods that areDouglas Gregor2012-12-111-1/+3
| | | | | | unavailable due to availability attributes. <rdar://problem/12798237> llvm-svn: 169903
* Format strings: offer a cast to 'unichar' for %C in Objective-C contexts.Jordan Rose2012-12-051-3/+3
| | | | | | | | | | | | | | | | | | | For most cases where a conversion specifier doesn't match an argument, we usually guess that the conversion specifier is wrong. However, if the argument is an integer type and the specifier is %C, it's likely the user really did mean to print the integer as a character. (This is more common than %c because there is no way to specify a unichar literal -- you have to write an integer literal, such as '0x2603', and then cast it to unichar.) This does not change the behavior of %S, since there are fewer cases where printing a literal Unicode *string* is necessary, but this could easily be changed in the future. <rdar://problem/11982013> llvm-svn: 169400
* Fix crash-on-invalid. <rdar://problem/12765391>.Eli Friedman2012-11-292-6/+29
| | | | llvm-svn: 168851
* objective-C: Do not issue deprecated warning about implementationFariborz Jahanian2012-11-171-2/+11
| | | | | | | of a deprecated method in original class (or category), only in overrides. // rdar://12717705 llvm-svn: 168270
* -Wobjc-literal-compare: look through implicit casts.Jordan Rose2012-11-091-0/+4
| | | | | | | | | This warning was failing to fire under ARC because of the implicit lifetime casts added around the object literal expression. <rdar://problem/11300873>, again. llvm-svn: 167648
* Update test case.Ted Kremenek2012-11-021-1/+1
| | | | llvm-svn: 167301
OpenPOWER on IntegriCloud