summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjCXX
Commit message (Collapse)AuthorAgeFilesLines
...
* objc++: patch for IRgen for atomic properties ofFariborz Jahanian2012-01-102-4/+4
| | | | | | | c++ objects with non-trivial assignment/copy functions. Also, one additional sema check. // rdar://6137845 llvm-svn: 147817
* Unrevert r147271, reverted in r147361.Richard Smith2011-12-301-8/+8
| | | | | | | | | | | | Also temporarily remove the assumption from IR gen that we can emit IR for every constant we can fold, since it isn't currently true in C++11, to fix PR11676. Original comment from r147271: constexpr: perform zero-initialization prior to / instead of performing a constructor call when appropriate. Thanks to Eli for spotting this. llvm-svn: 147384
* Revert r147271. This fixes PR11676.Rafael Espindola2011-12-301-8/+8
| | | | llvm-svn: 147362
* constexpr: perform zero-initialization prior to / instead of performing aRichard Smith2011-12-251-8/+8
| | | | | | constructor call when appropriate. Thanks to Eli for spotting this. llvm-svn: 147271
* "Accidentally" fixed a bug with overloading of functions withDouglas Gregor2011-12-151-0/+6
| | | | | | Objective-C objects as parameters in r146659. Add a test for it. llvm-svn: 146660
* In debugger support mode, if we have a top-level message sendDouglas Gregor2011-12-151-1/+2
| | | | | | | expression with an unknown result type, assume that the result type is 'id'. Fixes <rdar://problem/10400663>. llvm-svn: 146622
* Modify how the -verify flag works. Currently, the verification string andRichard Trieu2011-12-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | diagnostic message are compared. If either is a substring of the other, then no error is given. This gives rise to an unexpected case: // expect-error{{candidate function has different number of parameters}} will match the following error messages from Clang: candidate function has different number of parameters (expected 1 but has 2) candidate function has different number of parameters It will also match these other error messages: candidate function function has different number of parameters number of parameters This patch will change so that the verification string must be a substring of the diagnostic message before accepting. Also, all the failing tests from this change have been corrected. Some stats from this cleanup: 87 - removed extra spaces around verification strings 70 - wording updates to diagnostics 40 - extra leading or trailing characters (typos, unmatched parens or quotes) 35 - diagnostic level was included (error:, warning:, or note:) 18 - flag name put in the warning (-Wprotocol) llvm-svn: 146619
* Resolve placeholder expressions before trying to deduceJohn McCall2011-11-151-2/+11
| | | | | | | 'auto'. Introduce a convenience method to make this a bit easier, and use it elsewhere. llvm-svn: 144605
* Don't crash when a duplicate interface/protocol is inside an extern "C" context.Argyrios Kyrtzidis2011-11-131-0/+30
| | | | llvm-svn: 144508
* Improve text of a diagnostic. Fariborz Jahanian2011-10-311-3/+3
| | | | llvm-svn: 143353
* objc-arc: desugar certain type and improve on diagnostic forFariborz Jahanian2011-10-291-3/+3
| | | | | | | ownership qualifier cast which won't work. // rdar://10244607 llvm-svn: 143258
* objective-c arc: type-casting of an objc pointer toFariborz Jahanian2011-10-281-3/+6
| | | | | | | an rvalue retainable object type with life-time qualifier has no effect and wil be diagnosed as error. // rdar://10244607 llvm-svn: 143219
* Restore r142914 and r142915, now with missing file and apparentJohn McCall2011-10-251-1/+1
| | | | | | GCC compiler workaround. llvm-svn: 142931
* Revert r142914 and r142915, due to possibly missing file.NAKAMURA Takumi2011-10-251-1/+1
| | | | | | r142914: "Introduce a placeholder type for "pseudo object"" r142915: "Pull the pseudo-object stuff into its own file." llvm-svn: 142921
* Introduce a placeholder type for "pseudo object"John McCall2011-10-251-1/+1
| | | | | | | | | | | | | | | expressions: expressions which refer to a logical rather than a physical l-value, where the logical object is actually accessed via custom getter/setter code. A subsequent patch will generalize the AST for these so that arbitrary "implementing" sub-expressions can be provided. Right now the only client is ObjC properties, but this should be generalizable to similar language features, e.g. Managed C++'s __property methods. llvm-svn: 142914
* Teach the ARC compiler to not require __bridge casts whenJohn McCall2011-10-172-4/+107
| | | | | | | passing/receiving CF objects at +0 to/from Objective-C methods or audited C functions. llvm-svn: 142219
* Under ARC, merge the bit corresponding to the ns_returns_retainedDouglas Gregor2011-10-141-0/+8
| | | | | | | attribute from the first declaration to later declarations. Fixes <rdar://problem/10142572>. llvm-svn: 141957
* Update all tests other than Driver/std.cpp to use -std=c++11 rather thanRichard Smith2011-10-132-2/+2
| | | | | | -std=c++0x. Patch by Ahmed Charles! llvm-svn: 141900
* Don't complain about qualified property or ivar access when theDouglas Gregor2011-10-101-0/+2
| | | | | | qualifier itself is invalid. Crasher noticed by Fariborz. llvm-svn: 141544
* Diagnose attempts to qualify the name of an instance variable orDouglas Gregor2011-10-091-0/+15
| | | | | | property in an Objective-C++ member access expression. Fixes PR9759. llvm-svn: 141522
* objc++: some minor cleanup and a test caseFariborz Jahanian2011-10-072-2/+15
| | | | | | for atomic setters which requires assignment operator. llvm-svn: 141415
* objc++: For atomic properties of c++ class objec typet, appropriateFariborz Jahanian2011-10-062-1/+30
| | | | | | | operator= is called. Issue a warning for non-trivial case until runtime support is provided. // rdar://6137845 llvm-svn: 141302
* Make -fobjc-nonfragile-abi the -cc1 default, since it's theJohn McCall2011-10-0217-17/+17
| | | | | | | | | | | | | | | | | | | increasingly prevailing case to the point that new features like ARC don't even support the fragile ABI anymore. This required a little bit of reshuffling with exceptions because a check was assuming that ObjCNonFragileABI was only being set in ObjC mode, and that's actually a bit obnoxious to do. Most, though, it involved a perl script to translate a ton of test cases. Mostly no functionality change for driver users, although there are corner cases with disabling language-specific exceptions that we should handle more correctly now. llvm-svn: 140957
* objc++ arc: Diagnose block pointer type mismatch whenFariborz Jahanian2011-09-281-0/+20
| | | | | | | | some arguments types are ns_consumed and some otherwise matching types are not. This fixes the objc++ side only *auch*. // rdar://10187884 llvm-svn: 140717
* Remove the egregious hack that made Objective-C++ ARC work with olderDouglas Gregor2011-09-271-11/+0
| | | | | | | versions of libc++. Newer versions of libc++ know how to deal with ARC properly. Fixes <rdar://problem/10062179>. llvm-svn: 140651
* objc - redeclaration of property in extension classFariborz Jahanian2011-09-241-1/+1
| | | | | | | must match property type declaration in its primary class. // rdar://10142679 llvm-svn: 140438
* Don't assert when diagnosing a missing cast of an unknown-anytypeJohn McCall2011-08-311-0/+8
| | | | | | | | message send to an unknown method. rdar://problem/9416370, redux. llvm-svn: 138893
* objc - fix a bug exposed by my recent decl contextFariborz Jahanian2011-08-251-0/+9
| | | | | | changes. // rdar://10015110 llvm-svn: 138594
* Objective-C++ ARC: When performing template argument deduction for aDouglas Gregor2011-07-261-0/+14
| | | | | | | lifetime-qualified template parameter, ensure that the deduced template argument is a lifetime type. Fixes <rdar://problem/9828157>. llvm-svn: 136078
* arc-objc++: Issue an arc specific diagnostic when overload resolutionFariborz Jahanian2011-07-201-0/+19
| | | | | | | fails because of lifetime differences of parameter and argument type. // rdar://9790531 llvm-svn: 135593
* objc++: Some level of covariance is allowed in ObjC properties.Fariborz Jahanian2011-07-131-1/+0
| | | | | | | Make it also available in ObjC++ propeties. Use common code for objc and objc++ so they don't diverge. // rdar://9740328 llvm-svn: 135050
* revert fix for // rdar://9740328Fariborz Jahanian2011-07-121-0/+1
| | | | llvm-svn: 135010
* objc++: Some level of covariance is allowed in ObjC properties.Fariborz Jahanian2011-07-121-0/+19
| | | | | | Make it also available in ObjC++ propeties. // rdar://9740328 llvm-svn: 135001
* In ARC mode, consider Objective-C lifetime types (object pointers andDouglas Gregor2011-07-121-3/+4
| | | | | | | | | | | | | | block pointers) that don't have any qualification to be POD types. We were previously considering them to be non-POD types, because this was convenient in C++ for is_pod-like traits. However, we now end up inferring lifetime in such cases (template arguments infer __strong), so it is not necessary. Moreover, we want rvalues of object type (which have their lifetime stripped) to be PODs to allow, e.g., va_arg(arglist, id) to function properly. Fixes <rdar://problem/9758798>. llvm-svn: 134993
* objc++-arc: more diagnosis of converting a weak-unavailableFariborz Jahanian2011-07-081-4/+15
| | | | | | object to a __weak object type. // rdar://9732636 llvm-svn: 134706
* objc++-arc: diagnose assignment/cast of a weak-unavailableFariborz Jahanian2011-07-071-0/+36
| | | | | | | object to a __weak object/type. // rdar://9732636. One item is yet todo. llvm-svn: 134655
* Change the driver's logic about Objective-C runtimes: abstract out aJohn McCall2011-07-067-7/+7
| | | | | | | | | | | | structure to hold inferred information, then propagate each invididual bit down to -cc1. Separate the bits of "supports weak" and "has a native ARC runtime"; make the latter a CodeGenOption. The tool chain is still driving this decision, because it's the place that has the required deployment target information on Darwin, but at least it's better-factored now. llvm-svn: 134453
* -Fix mistake in ASTContext::getInnerObjCOwnership noticed by DougArgyrios Kyrtzidis2011-07-011-0/+1
| | | | | | | | -Remove unnecessary 'return'. -Remove unnecessary 'if' check (llvm_unreachable make sure attrStr will be non-null) -Add a test of transferring ownership to a reference cast type. llvm-svn: 134285
* Fix assertion hit in inferARCWriteback.Argyrios Kyrtzidis2011-07-011-0/+3
| | | | llvm-svn: 134276
* [ARC] When casting from a pointer to an objective-c object with known ↵Argyrios Kyrtzidis2011-07-011-2/+1
| | | | | | | | | | | | ownership, if the cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type to the cast type: id x; (NSString**)&x; // Casting as (__strong NSString**). llvm-svn: 134275
* [ARC] When casting from a pointer to an objective-c object with known ↵Argyrios Kyrtzidis2011-07-011-2/+22
| | | | | | | | | | | | | | ownership, if the cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type to the cast type: id x; static_cast<NSString**>(&x); // Casting as (__strong NSString**). This currently only works for C++ named casts, C casts to follow. llvm-svn: 134273
* Introduce Declarator::ObjCCatchContext, this will result in correct error ↵Argyrios Kyrtzidis2011-07-011-1/+5
| | | | | | for 'auto' in obj-c catch. llvm-svn: 134271
* ARC writeback isn't supposed to apply to local indirect pointers,John McCall2011-06-271-30/+30
| | | | | | only to pointers to locals. But it should work inside blocks, too. llvm-svn: 133969
* Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about ↵Argyrios Kyrtzidis2011-06-246-20/+20
| | | | | | | | 'ownership', not 'lifetime'. rdar://9477613. llvm-svn: 133779
* Improve on warning when objc pointer is used inFariborz Jahanian2011-06-231-1/+1
| | | | | | c++ catch in fragile abi - per Eli's request. llvm-svn: 133760
* Support for catching objc pointer objects in c++ catch-statementFariborz Jahanian2011-06-231-1/+1
| | | | | | in fragile abi mode and some other cleanups. // rdar://8940528 llvm-svn: 133747
* Objective-C++ ARC: eliminate the utterly unjustified loophole thatDouglas Gregor2011-06-171-0/+10
| | | | | | | | | | | silently dropped ownership qualifiers that were being applied to ownership-qualified, substituted type that was *not* a substituted template type parameter. We now provide a diagnostic in such cases, and recover by dropping the added qualifiers. Document this behavior in the ARC specification. llvm-svn: 133309
* Objective-ARC++: infer template type arguments ofDouglas Gregor2011-06-171-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ownership-unqualified retainable object type as __strong. This allows us to write, e.g., std::vector<id> and we'll infer that the vector's element types have __strong ownership semantics, which is far nicer than requiring: std::vector<__strong id> Note that we allow one to override the ownership qualifier of a substituted template type parameter, e.g., given template<typename T> struct X { typedef __weak T type; }; X<id> is treated the same as X<__strong id>. At instantiation type, the __weak in "__weak T" overrides the (inferred or specified) __strong on the template argument type, so that we can still provide metaprogramming transformations. This is part of <rdar://problem/9595486>. llvm-svn: 133303
* Put the new warning from revision 133196 on NULL arithmetic behind the flag ↵Richard Trieu2011-06-171-1/+1
| | | | | | -Wnull-arthimetic and set to DefaultIgnore. A few edge cases need to be worked out before this can be set to default. llvm-svn: 133287
* Add a new warning when a NULL constant is used in arithmetic operations. ↵Richard Trieu2011-06-161-0/+13
| | | | | | | | The warning will fire on cases such as: int x = 1 + NULL; llvm-svn: 133196
OpenPOWER on IntegriCloud