summaryrefslogtreecommitdiff
path: root/test/SemaObjCXX/arc-templates.mm
Commit message (Collapse)AuthorAge
* Objective-C ARC++: Prefer references to __strong/__weak over ↵Douglas Gregor2014-01-02
| | | | | | | | | __unsafe_unretained. Fixes <rdar://problem/15713945>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198343 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C++ ARC: Improve the conversion to a const __unsafe_unretained ↵Douglas Gregor2013-11-08
| | | | | | | | | | | | | | reference. Under ARC++, a reference to a const Objective-C pointer is implicitly treated as __unsafe_unretained, and can be initialized with (e.g.) a __strong lvalue. Make sure this behavior does not break template argument deduction and (related) that partial ordering still prefers a 'T* const&' template over a 'T const&' template when this case kicks in. Fixes <rdar://problem/14467941>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194239 91177308-0d34-0410-b5e6-96231b3b80d8
* In Objective-C ARC, completely ignore ownership qualifiers on theDouglas Gregor2013-01-17
| | | | | | | | | 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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172768 91177308-0d34-0410-b5e6-96231b3b80d8
* When performing the deduced/actual argument type check for C++Douglas Gregor2012-07-18
| | | | | | | | | [temp.deduct.call]p4 under Objective-C++ ARC, make sure to adjust the qualifiers to introduce the implicit strong lifetime when needed. Fixes <rdar://problem/11825671>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160412 91177308-0d34-0410-b5e6-96231b3b80d8
* Only complain about __strong __strong id, not __strong SomeStrongTypedefJohn McCall2012-02-08
| | | | | | or __strong __typeof__(some.strong.thing). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150029 91177308-0d34-0410-b5e6-96231b3b80d8
* Make -fobjc-nonfragile-abi the -cc1 default, since it's theJohn McCall2011-10-02
| | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140957 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C++ ARC: When performing template argument deduction for aDouglas Gregor2011-07-26
| | | | | | | | lifetime-qualified template parameter, ensure that the deduced template argument is a lifetime type. Fixes <rdar://problem/9828157>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136078 91177308-0d34-0410-b5e6-96231b3b80d8
* Change the driver's logic about Objective-C runtimes: abstract out aJohn McCall2011-07-06
| | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134453 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C++ ARC: eliminate the utterly unjustified loophole thatDouglas Gregor2011-06-17
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133309 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-ARC++: infer template type arguments ofDouglas Gregor2011-06-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133303 91177308-0d34-0410-b5e6-96231b3b80d8
* Automatic Reference Counting.John McCall2011-06-15
Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133103 91177308-0d34-0410-b5e6-96231b3b80d8