summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
Commit message (Collapse)AuthorAgeFilesLines
...
* Objective-C. Fixes a bug where "new" family attributeFariborz Jahanian2014-01-281-0/+14
| | | | | | | was not being overridden in the category method implementation resulting in bogus warning. // rdar://15919775 llvm-svn: 200342
* Another test for patch for // rdar://15890251Fariborz Jahanian2014-01-271-0/+6
| | | | llvm-svn: 200257
* ObjectiveC. Fixes a bug in recognition of an ivarFariborz Jahanian2014-01-271-0/+25
| | | | | | | backing a property resulting in bogus warning. // rdar://15890251 llvm-svn: 200254
* ObjectiveC. When introducing a new property declaration in Fariborz Jahanian2014-01-271-0/+12
| | | | | | | | parimary class and in mrr mode, assume property's default memory attribute (assign) and to prevent a bogus warning. // rdar://15859862 llvm-svn: 200238
* ObjectiveC. When issuing property implementation isFariborz Jahanian2014-01-221-0/+23
| | | | | | | | not using backing ivar warning, ignore when property is not being synthesized (user declared its implementation @dynamic). // rdar://1583425 llvm-svn: 199820
* Add basic checking for returning null from functions/methods marked ↵Ted Kremenek2014-01-221-1/+5
| | | | | | | | | | 'returns_nonnull'. This involved making CheckReturnStackAddr into a static function, which is now called by a top-level return value checking routine called CheckReturnValExpr. llvm-svn: 199790
* Wire up basic parser/sema support for attribute 'returns_nonnull'.Ted Kremenek2014-01-201-0/+3
| | | | | | | | | | | This attribute is supported by GCC. More generally it should probably be a type attribute, but this behavior matches 'nonnull'. This patch does not include warning logic for checking if a null value is returned from a function annotated with this attribute. That will come in subsequent patches. llvm-svn: 199626
* Add more test cases for attribute ↵Ted Kremenek2014-01-171-11/+44
| | | | | | 'objc_protocol_requires_explicit_implementation'. llvm-svn: 199480
* Enhance attribute 'nonnull' to be applicable to parameters directly (infix).Ted Kremenek2014-01-171-0/+14
| | | | | | | | | | | | | | | | | | | | | This allows the following syntax: void baz(__attribute__((nonnull)) const char *str); instead of: void baz(const char *str) __attribute__((nonnull(1))); This also extends to Objective-C methods. The checking logic in Sema is not as clean as I would like. Effectively now we need to check both the FunctionDecl/ObjCMethodDecl and the parameters, so the point of truth is spread in two places, but the logic isn't that cumbersome. Implements <rdar://problem/14691443>. llvm-svn: 199467
* ObjectiveC. Improve on diagnostics per Jordan's feedback.Fariborz Jahanian2014-01-151-3/+3
| | | | llvm-svn: 199278
* ObjectiveC. produce more expressive warning whenFariborz Jahanian2014-01-141-3/+3
| | | | | | | -Wselector detects an unimplemented method used in an @selector expression. // rdar://15781538 llvm-svn: 199255
* ObjectiveC. Remove warning on mismatched methodsFariborz Jahanian2014-01-101-7/+7
| | | | | | | | | which may belong to unrelated classes. It was primarily intended for miuse of @selector expression. But warning is too noisy and will be issued when an actual @selector is used. // rdar://15740134 llvm-svn: 198952
* ObjectiveC. 1) Warn when @dynamic (as well as synthesize) Fariborz Jahanian2014-01-101-6/+14
| | | | | | | | | property has the naming convention that implies 'ownership'. 2) improve on diagnostic and make it property specific. 3) fix the line number in the case of default property synthesis. // rdar://15757510 llvm-svn: 198905
* Have attribute 'objc_precise_lifetime' suppress -Wunused.Ted Kremenek2014-01-091-0/+9
| | | | | | | | | | Fixes <rdar://problem/15596883> In ARC, __attribute__((objc_precise_lifetime)) guarantees that the object stored in it will survive to the end of the variable's formal lifetime. It is therefore useful even if it completely unused. llvm-svn: 198888
* [objc] Refactor and improve functionality for the -Wunused-property-ivar ↵Argyrios Kyrtzidis2014-01-031-0/+23
| | | | | | | | | | | | | | warning. - Remove the additions to ObjCMethodDecl & ObjCIVarDecl that were getting de/serialized and consolidate all functionality for the checking for this warning in Sema::DiagnoseUnusedBackingIvarInAccessor - Don't check immediately after the method body is finished, check when the @implementation is finished. This is so we can see if the ivar was referenced by any other method, even if the method was defined after the accessor. - Don't silence the warning if any method is called from the accessor silence it if the accessor delegates to another method via self. rdar://15727325 llvm-svn: 198432
* Reworded the NSObject attribute diagnostics to be more consistent with other ↵Aaron Ballman2014-01-021-4/+4
| | | | | | attribute diagnostics. Also updated the associated test case. llvm-svn: 198368
* ObjectiveC. Remove false positive warning for missing propertyFariborz Jahanian2014-01-021-0/+20
| | | | | | | backing ivar by not issuing this warning if ivar is referenced somewhere and accessor makes method calls. // rdar://15727325 llvm-svn: 198367
* Updated the wording of two attribute-related diagnostics so that they print ↵Aaron Ballman2014-01-021-1/+1
| | | | | | the offending attribute name. Also updates the associated test cases. llvm-svn: 198355
* ObjectiveC. Class methods must be ignored when looking forFariborz Jahanian2014-01-021-0/+13
| | | | | | | property accessor's missing backing ivar. This eliminates the bogus warning being issued. // rdar://15728901 llvm-svn: 198322
* Wordsmith "maybe" into "may be" in diagnostic, and move warning under flag.Ted Kremenek2013-12-192-11/+11
| | | | llvm-svn: 197736
* After discussing with John McCall, removing the ns_bridged attribute as it ↵Aaron Ballman2013-12-191-15/+0
| | | | | | is unused. llvm-svn: 197729
* ObjectiveC. Sema test for property, methods Fariborz Jahanian2013-12-191-0/+9
| | | | | | 'section' attribute. // rdar://15450637 llvm-svn: 197704
* Implemented delayed processing of 'unavailable' checking, just like with ↵Ted Kremenek2013-12-1811-36/+35
| | | | | | | | | | | | | | | | | | | | | | | | | '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
* ObjectiveC. Fixes the sentence in a diagnostic.Fariborz Jahanian2013-12-181-1/+1
| | | | | | // rdar://15397430 llvm-svn: 197586
* ObjectiveC. typo fix in my last patch,Fariborz Jahanian2013-12-181-2/+2
| | | | | | per Jordan's review. llvm-svn: 197540
* Objctive-C. warn if dealloc is being overridden inFariborz Jahanian2013-12-171-2/+18
| | | | | | a category implementation. // rdar://15397430 llvm-svn: 197534
* ObjectiveC. Further improvements of useFariborz Jahanian2013-12-162-18/+18
| | | | | | | | | | of objc_bridge_related attribute; eliminate unnecessary diagnostics which is issued elsewhere, fixit now produces a valid AST tree per convention. This results in some simplification in handling of this attribute as well. // rdar://15499111 llvm-svn: 197436
* Fix test containing backslash and newline separated by spaceAlp Toker2013-12-141-1/+1
| | | | | | This was silently accepted by clang without warning due to a lexer bug. llvm-svn: 197330
* [objc] Add a test to make sure that a class can add a secondary initializer ↵Argyrios Kyrtzidis2013-12-141-1/+20
| | | | | | | | via a category and still inherit the designated initializers of its super class. llvm-svn: 197301
* Objective-C. Remove obsolete option from test.Fariborz Jahanian2013-12-131-1/+1
| | | | | | // rdar://15641300 llvm-svn: 197263
* Objective-C. Do not issue warning when 'readonly'Fariborz Jahanian2013-12-134-17/+18
| | | | | | | | | | | | | | property declaration has a memory management attribute (retain, copy, etc.). Sich properties are usually overridden to become 'readwrite' via a class extension (which require the memory management attribute specified). In the absence of class extension override, memory management attribute is needed to produce correct Code Gen. for the property getter in any case and this warning becomes confusing to user. // rdar://15641300 llvm-svn: 197251
* Refine 'objc_protocol_requires_explicit_implementation' attribute to better ↵Ted Kremenek2013-12-131-0/+46
| | | | | | handle indirect protocols. llvm-svn: 197209
* Change 'method X in protocol not implemented' warning to include the name of ↵Ted Kremenek2013-12-137-21/+18
| | | | | | | | | the protocol. This removes an extra "note:", which wasn't really all that more useful and overall reduces the diagnostic spew for this case. llvm-svn: 197207
* [objc] If we don't know for sure what the designated initializers of the ↵Argyrios Kyrtzidis2013-12-131-0/+16
| | | | | | | | | superclass are, assume that a [super init..] inside a designated initializer also refers to a designated one and do not warn. llvm-svn: 197202
* Enhance "auto synthesis will not synthesize property in protocol" to include ↵Ted Kremenek2013-12-123-4/+4
| | | | | | | | property and protocol name. Implements <rdar://problem/15617839>. llvm-svn: 197187
* Add more test cases for 'objc_protocol_requires_explicit_implementation'.Ted Kremenek2013-12-121-0/+19
| | | | llvm-svn: 197128
* ObjectiveC. Fixes a bug where an 'unused property ivar'Fariborz Jahanian2013-12-111-0/+17
| | | | | | | warning is coming out incorrectly too early becuase of unrelated scope pop. // rdar://15630719 llvm-svn: 196989
* Objective-C. Minor change to a diagnostic.Fariborz Jahanian2013-12-102-10/+10
| | | | | | // rdar://15499111 llvm-svn: 196977
* Rename attribute 'objc_suppress_protocol_methods' to ↵Ted Kremenek2013-12-101-61/+19
| | | | | | | | | | | | | | | 'objc_protocol_requires_explicit_implementation'. That's a mouthful, and not necessarily the final name. This also reflects a semantic change where this attribute is now on the protocol itself instead of a class. This attribute will require that a protocol, when adopted by a class, is explicitly implemented by the class itself (instead of walking the super class chain). Note that this attribute is not "done". This should be considered a WIP. llvm-svn: 196955
* Improve on an objc_bridge_related diagnostic.Fariborz Jahanian2013-12-102-10/+10
| | | | | | // rdar://15499111 llvm-svn: 196950
* Objective-C: Improve on various diagnostics related toFariborz Jahanian2013-12-093-57/+27
| | | | | | use of objc_bridge_related attribute. // rdar://15499111 llvm-svn: 196828
* Fix three tests that weren't checking anythingAlp Toker2013-12-081-0/+1
| | | | | | | | Add -verify and update the test directives to match current expectations. Also add a FIXME to an ObjC test that has expected-* directives but no -verify. llvm-svn: 196737
* Add a SubsetSubject in Attr.td to automate checking of where the ↵Argyrios Kyrtzidis2013-12-071-8/+8
| | | | | | | | objc_designated_initializer attribute is acceptable. llvm-svn: 196644
* ObjectiveC. Continuing implementation of objc_bridge_relatedFariborz Jahanian2013-12-073-0/+153
| | | | | | | | | attribute in sema and issuing a variety of diagnostics lazily for misuse of this attribute (and what to do) when converting from CF types to ObjectiveC types (and vice versa). // rdar://15499111 llvm-svn: 196629
* ObjectiveC: Don't warn when method implemented inFariborz Jahanian2013-12-051-0/+26
| | | | | | | | category is declared in category's primary class's super class. Because the super class is expected to implemented the method. // rdar://15580969 llvm-svn: 196531
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-054-5/+5
| | | | llvm-svn: 196510
* [objc] If an interface has no initializer marked as designated and ↵Argyrios Kyrtzidis2013-12-051-1/+27
| | | | | | | | | | | introduces at least one new initializer, don't assume that it inherits the designated initializers from the super class. If the assumption was wrong because a new initializer was a designated one that was not marked as such, we will emit misleading warnings for subclasses of the interface. llvm-svn: 196476
* Correct hyphenations in comments and assert messagesAlp Toker2013-12-051-1/+1
| | | | | | | This patch tries to avoid unrelated changes other than fixing a few hyphen-related ambiguities in nearby lines. llvm-svn: 196466
* [objc] Add a warning when a class that provides a designated initializer, ↵Argyrios Kyrtzidis2013-12-031-6/+8
| | | | | | | | does not override all of the designated initializers of its superclass. llvm-svn: 196319
* [objc] Emit warning when the implementation of a secondary initializer calls onArgyrios Kyrtzidis2013-12-031-3/+43
| | | | | | | | | | | super another initializer and when the implementation does not delegate to another initializer via a call on 'self'. A secondary initializer is an initializer method not marked as a designated initializer within a class that has at least one initializer marked as a designated initializer. llvm-svn: 196318
OpenPOWER on IntegriCloud