aboutsummaryrefslogtreecommitdiff
path: root/clang/test/SemaObjC
AgeCommit message (Collapse)AuthorFilesLines
2013-11-20Merging r195146:Bill Wendling1-0/+5
------------------------------------------------------------------------ r195146 | fjahanian | 2013-11-19 11:26:30 -0800 (Tue, 19 Nov 2013) | 4 lines ObjectiveC ARC. Removes a bogus warning when a weak property is redeclared as 'weak' in class extension. // rdar://15465916 ------------------------------------------------------------------------ llvm-svn: 195224
2013-11-19Merging r195135:Bill Wendling1-7/+7
------------------------------------------------------------------------ r195135 | fjahanian | 2013-11-19 09:42:25 -0800 (Tue, 19 Nov 2013) | 3 lines bjectiveC. Use a uniform diagnostic for 'objc_bridge' attribute. // rdar://15454846. ------------------------------------------------------------------------ llvm-svn: 195141
2013-11-19ObjectiveC 'objc_bridging'. Assorment of improvements Fariborz Jahanian1-10/+10
per Doug/Jordan comments. // rdar://15454846. llvm-svn: 195066
2013-11-19ObjectiveC ARC. Adopt objc_bridge attributeFariborz Jahanian1-16/+23
on struct/union/class instead of typedef of such types. // rdar://15454846 llvm-svn: 195061
2013-11-16ObjectiveC ARC. More validation of toll-free bridging ofFariborz Jahanian1-2/+4
CF objects with objc_bridge'ing annotaiton. // rdar://15454846 llvm-svn: 194938
2013-11-16ObjectiveC ARC. Validate toll free bridge castingFariborz Jahanian1-2/+4
of ObjectiveC objects to CF types when CF type has the objc_bridge attribute. llvm-svn: 194930
2013-11-16ObjetiveC ARC. Start diagnosing invalid toll free bridging.Fariborz Jahanian1-2/+4
// rdar://15454846. llvm-svn: 194915
2013-11-15ObjectiveC ARC. Only briding of pointer to struct CF object is allowed.Fariborz Jahanian1-5/+5
Improve on wording on illegal objc_bridge argumment. // rdar://15454846 llvm-svn: 194881
2013-11-15ObjectiveC ARG. A positive test of my previous patch.Fariborz Jahanian1-1/+16
// rdar://15454846 llvm-svn: 194864
2013-11-15ObjectiveC ARC. Lookup type associated with objc_bridage atFariborz Jahanian1-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
2013-11-15ObjectiveC. Fixes a bogus warning of unused backingFariborz Jahanian1-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
2013-11-14Revert r194663 and r194647.Ted Kremenek1-11/+0
Per feedback from Jordan Rose I realized this wasn't the right way to go. llvm-svn: 194664
2013-11-14Refine -Wunused-variable to only suppress warning for __bridge_transfer, not ↵Ted Kremenek1-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
2013-11-14Suppress -Wunused-variable when initializer uses bridge casts for memory ↵Ted Kremenek1-0/+12
management. Fixes <rdar://problem/15432770>. llvm-svn: 194647
2013-11-14Use a more realistic NS class names in Fariborz Jahanian1-8/+8
objc_bridge attributes in my previous test. Per Jordan's comment. llvm-svn: 194645
2013-11-14ObjectiveC ARC. objc_bridge attribute should be applied toFariborz Jahanian1-9/+9
toll-free bridging cf types only. // rdar//15454846 wip. llvm-svn: 194640
2013-11-13ObjectiveC ARC. Introduce a new attribute, 'objc_bridge'Fariborz Jahanian1-0/+29
that teaches the compiler about a subset of toll-free bridging semantics. This is wip. // rdar://15454846 llvm-svn: 194633
2013-11-05ObjectiveC. Method implementations should only check forFariborz Jahanian1-5/+26
"Missing call to Super" in the overriding method and not in the method itself. // rdar://15385981. llvm-svn: 194031
2013-11-01ObjectiveC. Define a new cc1 flag Fariborz Jahanian2-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
2013-10-31Factor out custom parsing for iboutletcollection and vec_type_hint attributesRichard Smith1-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
2013-10-26ObjectiveC arc. Warn when an implicitly 'strong' property Fariborz Jahanian1-0/+13
is redeclared as 'weak' in class extension. // rdar://15304886 llvm-svn: 193453
2013-10-25ObjectiveC: under -Wunused-property-ivar warn if property'sFariborz Jahanian1-0/+51
backing warning is not used in one of its accessor methods. // rdar://14989999 llvm-svn: 193439
2013-10-18ObjectiveC. Added support for methods annotated with format_argFariborz Jahanian1-4/+24
attributes when such methods are actually envoked in message expression. // rdar://15242010 llvm-svn: 193003
2013-10-15Special case '%C' handling in ObjC format strings to handle integer literals ↵Ted Kremenek1-0/+5
that can represent unicode characters Fixes <rdar://problem/13991617>. llvm-svn: 192673
2013-10-14GetExprRange() (used by -Wconversion checking) should look through ↵Ted Kremenek1-0/+17
OpaqueValueExprs. Fixes a false positive with -Wconversion involving Objective-C properties. Fixes <rdar://problem/14415662>. llvm-svn: 192611
2013-10-14Do not use typo correction that is unaccessible.Serge Pavlov2-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
2013-10-10ObjectiveC. ObjectiveC's collection selector expression inFariborz Jahanian1-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
2013-10-09Refine string literal concatenation warning within an NSArray literal to not ↵Ted Kremenek1-0/+8
warn when the literal comes from a macro expansion. Fixes <rdar://problem/15147688>. llvm-svn: 192328
2013-10-07ObjectiveC: Warn when 'readonly' property has explicitFariborz Jahanian3-8/+8
ownership attribute (such as 'copy', 'assign' etc.) // rdar://15131088 llvm-svn: 192115
2013-10-04ObjectiveC. Allow readonly properties without an explicit ownershipFariborz Jahanian1-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
2013-09-27Replace -fobjc-default-synthesize-properties with ↵Rafael Espindola20-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
2013-09-27Don't give suggest things like function names on the left side of "=".Kaelyn Uhrain1-3/+2
llvm-svn: 191545
2013-09-25ObjectiveC: Handle the case of qualifying protocolsFariborz Jahanian1-0/+24
declared in a typedef declaraton used as super class of an ObjC class. Curretnly, these protocols are dropped from the class hierarchy. Test shows that it is now included. // rdar://15051465 llvm-svn: 191395
2013-09-19Refinement to my previous patch forFariborz Jahanian1-0/+2
objc_returns_inner_pointer on properties. // rdar://14990439 llvm-svn: 191016
2013-09-19ObjectiveC: Allow NS_RETURNS_INNER_POINTER annotation Fariborz Jahanian1-1/+4
of ObjectiveC properties to mean annotation of NS_RETURNS_INNER_POINTER on its synthesized getter. This also facilitates more migration to properties when methods are annotated with NS_RETURNS_INNER_POINTER. // rdar://14990439 llvm-svn: 191009
2013-09-12Fix regression from r190427.Eli Friedman1-0/+5
<rdar://problem/14970968> llvm-svn: 190635
2013-09-06Add self-comparison warnings for fields.Eli Friedman1-0/+12
This expands very slightly what -Wtautological-compare considers to be tautological to include implicit accesses to C++ fields and ObjC ivars. I don't want to turn this into a full expression-identity check, but these additions seem pretty well-contained, and maintain the theme of checking for "x == x". <rdar://problem/14431127> llvm-svn: 190118
2013-09-01Improving objc_ownership attribute test coverage.Aaron Ballman1-0/+6
llvm-svn: 189731
2013-08-31Consolidating the notion of a GNU attribute parameter with the attribute ↵Aaron Ballman1-0/+2
argument list. llvm-svn: 189711
2013-08-14ObjectiveC [Sema]. This patch makes sure that all inheritedFariborz Jahanian1-0/+49
properties (direct or indirect) setter/getter (or declared methods as well) are seen by the method implementation type matching logic before declaration of method in super class is seen. This fixes the warning coming out of that method mismatch. // rdar://14650159 llvm-svn: 188438
2013-08-14Refine diagnostics in my last patch.Fariborz Jahanian1-1/+1
// rdar://14303083 llvm-svn: 188335
2013-08-13ObjectiveC [QoI] issue warning if an element of an nsarrayFariborz Jahanian1-0/+6
expresison is a concatenated nsstring element. // rdar://14303083 llvm-svn: 188332
2013-08-05Implement C++'s restrictions on the type of an expression passed to a varargRichard Smith1-0/+2
function: it can't be 'void' and it can't be an initializer list. We give a hard error for these rather than treating them as undefined behavior (we can and probably should do the same for non-POD types in C++11, but as of this change we don't). Slightly rework the checking of variadic arguments in a function with a format attribute to ensure that certain kinds of format string problem (non-literal string, too many/too few arguments, ...) don't suppress this error. llvm-svn: 187735
2013-07-31ObjectiveC ARC: finishing off issuing error whenFariborz Jahanian1-0/+12
retainable pointer is passed to an audited CF function expecting CF type. // rdar://14569171 llvm-svn: 187543
2013-07-30err_attribute_not_string has been subsumed by err_attribute_argument_type.Aaron Ballman1-2/+2
llvm-svn: 187400
2013-07-23Added the attribute name to the err_attribute_wrong_number_arguments ↵Aaron Ballman7-10/+10
diagnostic for clarity; updated almost all of the affected test cases. Thanks to Fariborz Jahanian for the suggestion! llvm-svn: 186980
2013-07-23Going back to using getName for consistency.Aaron Ballman1-1/+1
llvm-svn: 186966
2013-07-23Fixing the build bots from the previous commit.Aaron Ballman3-3/+3
llvm-svn: 186947
2013-07-23Replacing some manual diagnostic checks with an existing helper method. ↵Aaron Ballman3-0/+11
Adding missing test cases for the diagnostics. llvm-svn: 186944
2013-07-23Correcting the NSObject and Overloadable attribute diagnostics so that the ↵Aaron Ballman1-0/+2
count reported matches reality. llvm-svn: 186936