summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC
Commit message (Collapse)AuthorAgeFilesLines
...
* [objc] Emit warnings when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-031-8/+17
| | | | | | | | calls on super an initializer that is not a designated one or any initializer on self. llvm-svn: 196317
* [objc] Emit a warning when the implementation of a designated initializer ↵Argyrios Kyrtzidis2013-12-031-0/+96
| | | | | | | | does not chain to an init method that is a designated initializer for the superclass. llvm-svn: 196316
* [objc] Introduce attribute 'objc_designated_initializer'.Argyrios Kyrtzidis2013-12-031-0/+32
| | | | | | It only applies to methods of init family in an interface declaration. llvm-svn: 196314
* Enables support for custom subject lists for attributes. As a testbed, uses ↵Aaron Ballman2013-11-291-2/+2
| | | | | | the custom subject for the ibaction attribute. llvm-svn: 195960
* Making some attribute diagnostics more consistent. Removes a newly-unused ↵Aaron Ballman2013-11-242-1/+3
| | | | | | | | diagnostic. Reviewed by Fariborz Jahanian llvm-svn: 195578
* Remove optional parameter bit from attribute ObjCSuppressProtocol.Ted Kremenek2013-11-231-2/+2
| | | | | | This refines some diagnostics and reduces some boilerplate checking logic. llvm-svn: 195560
* Add back experimental attribute objc_suppress_protocol_methods (slightly ↵Ted Kremenek2013-11-231-0/+79
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | renamed). This is still an experimental attribute, but I wanted it in tree for review. It may still get yanked. This attribute can only be applied to a class @interface, not a class extension or category. It does not change the type system rules for Objective-C, but rather the implementation checking for Objective-C classes that explicitly conform to a protocol. During protocol conformance checking, clang recursively searches up the class hierarchy for the set of methods that compose a protocol. This attribute will cause the compiler to not consider the methods contributed by a super class, its categories, and those from its ancestor classes. Thus this attribute is used to force subclasses to redeclare (and hopefully re-implement) methods if they decide to explicitly conform to a protocol where some of those methods may be provided by a super class. This attribute intentionally leaves out properties, which are associated with state. This attribute only considers methods (at least right now) that are non-property accessors. These represent methods that "do something" as dictated by the protocol. This may be further refined, and this should be considered a WIP until documentation gets written or this gets removed. llvm-svn: 195533
* ObjectiveC. Remove warning diagnostic which checksFariborz Jahanian2013-11-231-8/+8
| | | | | | | | | | | | | | attribute on method declaration and implementation match. This makes no sense. Most annotations are meant for declarations only and one is for implementation. This has been constant source of regresions and hackery to get around special cases. I am removing this check. Such checks must be done on a case by case basis and when it makes sense. For example, it makes sense for availability/deprecated and I will file a radar for that. // rdar://15531984 llvm-svn: 195524
* ObjectiveC migrator. Improve on definition, useFariborz Jahanian2013-11-223-3/+15
| | | | | | | | and testing of objc_bridgmutable attribute per Aaron Ballman's comments. // rdar://15498044 llvm-svn: 195396
* ObjectiveC. Implement attribute 'objc_bridge_mutable'Fariborz Jahanian2013-11-211-0/+19
| | | | | | | | whose semantic is currently identical to objc_bridge, but their differences may manifest down the road with further enhancements. // rdar://15498044 llvm-svn: 195376
* Revert "Add new attribute 'objc_suppress_protocol' to suppress protocol ↵Ted Kremenek2013-11-211-27/+0
| | | | | | | | | | | conformance for a class." After implementing this patch, a few concerns about the language feature itself emerged in my head that I had previously not considered. I want to resolve those design concerns first before having a half-designed language feature in the tree. llvm-svn: 195328
* Add new attribute 'objc_suppress_protocol' to suppress protocol conformance ↵Ted Kremenek2013-11-211-0/+27
| | | | | | | | | | | | | | | | | | | | | | | for a class. The idea is to allow a class to stipulate that its methods (and those of its parents) cannot be used for protocol conformance in a subclass. A subclass is then explicitly required to re-implement those methods of they are present in the class marked with this attribute. Currently the attribute can only be applied to an @interface, and not a category or class extension. This is by design. Unlike protocol conformance, where a category can add explicit conformance of a protocol to class, this anti-conformance really needs to be observed uniformly by all clients of the class. That's because the absence of the attribute implies more permissive checking of protocol conformance. This unfortunately required changing method lookup in ObjCInterfaceDecl to take an optional protocol parameter. This should not slow down method lookup in most cases, and is just used for protocol conformance. llvm-svn: 195323
* ObjectiveC. Allow toll free bridge cast warnings outsideFariborz Jahanian2013-11-212-15/+143
| | | | | | | ARC and in objectiveC/ObjectiveC++ MRR mode as well. // rdar://15454846 llvm-svn: 195288
* ObjectiveC ARC. warn in presense of __bridge casting to Fariborz Jahanian2013-11-201-3/+13
| | | | | | or from a toll free bridge cast. // rdar://15454846 llvm-svn: 195278
* ObjectiveC ARC. Better checking of toll free briding Fariborz Jahanian2013-11-201-0/+24
| | | | | | | from qualified-id objects to CF types with objc_bridge annotation. // rdar://15454846 llvm-svn: 195264
* Refine 'deprecated' checking for Objective-C classes/methods.Ted Kremenek2013-11-201-0/+38
| | | | | | | | | - If a deprecated class refers to another deprecated class, do not warn. - @implementations of a deprecated class can refer to other deprecated things. Fixes <rdar://problem/15407366> and <rdar://problem/15466783>. llvm-svn: 195259
* ObjectiveC ARC. validate toll free bridge castingFariborz Jahanian2013-11-201-4/+43
| | | | | | | to or from 'id' and qualified-id types. // rdar://15454846 llvm-svn: 195178
* ObjectiveC ARC. Removes a bogus warning when a weak Fariborz Jahanian2013-11-191-0/+5
| | | | | | | property is redeclared as 'weak' in class extension. // rdar://15465916 llvm-svn: 195146
* bjectiveC. Use a uniform diagnostic forFariborz Jahanian2013-11-191-7/+7
| | | | | | 'objc_bridge' attribute. // rdar://15454846. llvm-svn: 195135
* Giving this test a triple since it uses a calling convention attribute.Aaron Ballman2013-11-191-1/+1
| | | | llvm-svn: 195099
* Improving calling convention test coverage by adding tests for things not ↵Aaron Ballman2013-11-191-0/+5
| | | | | | currently handled. Specifically: the diagnostics in SemaDeclAttr.cpp, and ensuring that calling convention attributes are applied to ObjC method declarations. No functional changes. llvm-svn: 195098
* ObjectiveC 'objc_bridging'. Assorment of improvements Fariborz Jahanian2013-11-191-10/+10
| | | | | | per Doug/Jordan comments. // rdar://15454846. llvm-svn: 195066
* ObjectiveC ARC. Adopt objc_bridge attributeFariborz Jahanian2013-11-191-16/+23
| | | | | | | on struct/union/class instead of typedef of such types. // rdar://15454846 llvm-svn: 195061
* ObjectiveC ARC. More validation of toll-free bridging ofFariborz Jahanian2013-11-161-2/+4
| | | | | | | CF objects with objc_bridge'ing annotaiton. // rdar://15454846 llvm-svn: 194938
* ObjectiveC ARC. Validate toll free bridge castingFariborz Jahanian2013-11-161-2/+4
| | | | | | | of ObjectiveC objects to CF types when CF type has the objc_bridge attribute. llvm-svn: 194930
* ObjetiveC ARC. Start diagnosing invalid toll free bridging.Fariborz Jahanian2013-11-161-2/+4
| | | | | | // rdar://15454846. llvm-svn: 194915
* ObjectiveC ARC. Only briding of pointer to struct CF object is allowed.Fariborz Jahanian2013-11-151-5/+5
| | | | | | | Improve on wording on illegal objc_bridge argumment. // rdar://15454846 llvm-svn: 194881
* ObjectiveC ARG. A positive test of my previous patch.Fariborz Jahanian2013-11-151-1/+16
| | | | | | // rdar://15454846 llvm-svn: 194864
* ObjectiveC ARC. Lookup type associated with objc_bridage atFariborz Jahanian2013-11-151-1/+10
| | | | | | | | the point of CF object type-cast and issue diagnostic if it is not a valid ObjectiveC class. // rdar//15454846. This is wip. llvm-svn: 194861
* ObjectiveC. Fixes a bogus warning of unused backingFariborz Jahanian2013-11-151-0/+25
| | | | | | | | ivar when property belongs to a super class and currnt class happens to have a method with same name as property. // rdar//15473432 llvm-svn: 194830
* Revert r194663 and r194647.Ted Kremenek2013-11-141-11/+0
| | | | | | Per feedback from Jordan Rose I realized this wasn't the right way to go. llvm-svn: 194664
* Refine -Wunused-variable to only suppress warning for __bridge_transfer, not ↵Ted Kremenek2013-11-141-6/+5
| | | | | | | | | all bridge casts. Also refine test case to capture the intention of this suppression. Essentially some developers use __bridge_transfer as if it were a safe CFRelease. llvm-svn: 194663
* Suppress -Wunused-variable when initializer uses bridge casts for memory ↵Ted Kremenek2013-11-141-0/+12
| | | | | | | | management. Fixes <rdar://problem/15432770>. llvm-svn: 194647
* Use a more realistic NS class names in Fariborz Jahanian2013-11-141-8/+8
| | | | | | | objc_bridge attributes in my previous test. Per Jordan's comment. llvm-svn: 194645
* ObjectiveC ARC. objc_bridge attribute should be applied toFariborz Jahanian2013-11-141-9/+9
| | | | | | toll-free bridging cf types only. // rdar//15454846 wip. llvm-svn: 194640
* ObjectiveC ARC. Introduce a new attribute, 'objc_bridge'Fariborz Jahanian2013-11-131-0/+29
| | | | | | | that teaches the compiler about a subset of toll-free bridging semantics. This is wip. // rdar://15454846 llvm-svn: 194633
* ObjectiveC. Method implementations should only check forFariborz Jahanian2013-11-051-5/+26
| | | | | | | "Missing call to Super" in the overriding method and not in the method itself. // rdar://15385981. llvm-svn: 194031
* ObjectiveC. Define a new cc1 flag Fariborz Jahanian2013-11-012-0/+4
| | | | | | | | | | | -fobjc-subscripting-legacy-runtime which is off by default and on only when using ObjectiveC legacy runtime. Use this flag to allow array and dictionary subscripting and disallow objectiveC pointer arithmatic in ObjectiveC legacy runtime. // rdar://15363492 llvm-svn: 193889
* Factor out custom parsing for iboutletcollection and vec_type_hint attributesRichard Smith2013-10-311-5/+5
| | | | | | | | | into a separate "parse an attribute that takes a type argument" codepath. This results in both codepaths being a lot cleaner and simpler, and fixes some bugs where the type argument handling bled into the expression argument handling and caused us to both accept invalid and reject valid attribute arguments. llvm-svn: 193731
* ObjectiveC arc. Warn when an implicitly 'strong' property Fariborz Jahanian2013-10-261-0/+13
| | | | | | | is redeclared as 'weak' in class extension. // rdar://15304886 llvm-svn: 193453
* ObjectiveC: under -Wunused-property-ivar warn if property'sFariborz Jahanian2013-10-251-0/+51
| | | | | | | backing warning is not used in one of its accessor methods. // rdar://14989999 llvm-svn: 193439
* ObjectiveC. Added support for methods annotated with format_argFariborz Jahanian2013-10-181-4/+24
| | | | | | | attributes when such methods are actually envoked in message expression. // rdar://15242010 llvm-svn: 193003
* Special case '%C' handling in ObjC format strings to handle integer literals ↵Ted Kremenek2013-10-151-0/+5
| | | | | | | | that can represent unicode characters Fixes <rdar://problem/13991617>. llvm-svn: 192673
* GetExprRange() (used by -Wconversion checking) should look through ↵Ted Kremenek2013-10-141-0/+17
| | | | | | | | | | OpaqueValueExprs. Fixes a false positive with -Wconversion involving Objective-C properties. Fixes <rdar://problem/14415662>. llvm-svn: 192611
* Do not use typo correction that is unaccessible.Serge Pavlov2013-10-142-2/+2
| | | | | | | | This patch fixes PR17019. When doing typo correction, Sema::CorrectTypo uses correction already seen for the same typo. This causes problems if that correction is from another scope and cannot be accessed in the current. llvm-svn: 192594
* ObjectiveC. ObjectiveC's collection selector expression inFariborz Jahanian2013-10-101-0/+10
| | | | | | | | the fereach loop must be a non-const lvalue expression as it will be assigned to at the beginning of the loop. // rdar://15123684 llvm-svn: 192399
* Refine string literal concatenation warning within an NSArray literal to not ↵Ted Kremenek2013-10-091-0/+8
| | | | | | warn when the literal comes from a macro expansion. Fixes <rdar://problem/15147688>. llvm-svn: 192328
* ObjectiveC: Warn when 'readonly' property has explicitFariborz Jahanian2013-10-073-8/+8
| | | | | | | ownership attribute (such as 'copy', 'assign' etc.) // rdar://15131088 llvm-svn: 192115
* ObjectiveC. Allow readonly properties without an explicit ownershipFariborz Jahanian2013-10-041-0/+19
| | | | | | | | (assign/unsafe_unretained/weak/retain/strong/copy) in super class to be overridden by a property with any explicit ownership in the subclass. // rdar://15014468 llvm-svn: 191971
* Replace -fobjc-default-synthesize-properties with ↵Rafael Espindola2013-09-2720-25/+25
| | | | | | | | | disable-objc-default-synthesize-properties. We want the modern behavior most of the time, so inverting the option simplifies the driver and the tests. llvm-svn: 191551
OpenPOWER on IntegriCloud