forked from OSchip/llvm-project
When taking the address of a value of Objective-C object type (e.g.,
one because we're referencing a variable of type NSString &), the resulting type is an ObjCObjectPointerType. llvm-svn: 109753
This commit is contained in:
parent
4a338e3dc4
commit
0bdcb8a239
|
@ -6313,6 +6313,8 @@ QualType Sema::CheckAddressOfOperand(Expr *op, SourceLocation OpLoc) {
|
|||
}
|
||||
|
||||
// If the operand has type "type", the result has type "pointer to type".
|
||||
if (op->getType()->isObjCObjectType())
|
||||
return Context.getObjCObjectPointerType(op->getType());
|
||||
return Context.getPointerType(op->getType());
|
||||
}
|
||||
|
||||
|
|
|
@ -24,3 +24,10 @@ int f2(A *a) {
|
|||
return f0(a.p1); // expected-error {{property 'p1' not found on object of type 'A *'}}
|
||||
}
|
||||
|
||||
// PR7740
|
||||
@class NSString;
|
||||
|
||||
void f3(id);
|
||||
void f4(NSString &tmpstr) {
|
||||
f3(&tmpstr);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue