]> granicus.if.org Git - clang/commit
[ARC] When casting from a pointer to an objective-c object with known ownership,...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 1 Jul 2011 22:22:50 +0000 (22:22 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Fri, 1 Jul 2011 22:22:50 +0000 (22:22 +0000)
commit31862ba5ea70b1f2c81d03f8a0100b61cd6f06f6
tree846172986f567421d3bea3e783fe784601dff541
parent8cfa57b348d4d5a58d92764a60280bf88e4e49ae
[ARC] When casting from a pointer to an objective-c object with known 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134273 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/ASTContext.h
include/clang/Sema/Sema.h
lib/AST/ASTContext.cpp
lib/Parse/ParseExprCXX.cpp
lib/Sema/SemaCXXCast.cpp
lib/Sema/SemaType.cpp
test/CXX/dcl.dcl/dcl.spec/dcl.type/dcl.spec.auto/p5.cpp
test/SemaObjCXX/arc-type-conversion.mm