summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-03-30 16:59:30 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-03-30 16:59:30 +0000
commit20688ccc4869f7d85681cbbf13e3878784d6aab8 (patch)
tree8b8547420ad12b91b6d363a1d245698c2dd210b8 /clang/lib/Sema
parent464280542b96387513b4a2a74c6556f27dad2153 (diff)
downloadbcm5719-llvm-20688ccc4869f7d85681cbbf13e3878784d6aab8.tar.gz
bcm5719-llvm-20688ccc4869f7d85681cbbf13e3878784d6aab8.zip
de-sugared when accessing property reference type.
Add a test case for synthesize ivar. // rdar://9070460 llvm-svn: 128554
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp2
-rw-r--r--clang/lib/Sema/SemaObjCProperty.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 22b0f03a52d..9ebc7de84d3 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -7421,7 +7421,7 @@ static bool IsConstProperty(Expr *E, Sema &S) {
ObjCPropertyDecl *PDecl = PropExpr->getExplicitProperty();
QualType T = PDecl->getType();
if (T->isReferenceType())
- T = cast<ReferenceType>(T)->getPointeeType();
+ T = T->getAs<ReferenceType>()->getPointeeType();
CanQualType CT = S.Context.getCanonicalType(T);
return CT.isConstQualified();
}
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp
index 43e30275e2f..95a365cacf6 100644
--- a/clang/lib/Sema/SemaObjCProperty.cpp
+++ b/clang/lib/Sema/SemaObjCProperty.cpp
@@ -540,7 +540,7 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S,
ParmVarDecl *Param = (*P);
QualType T = Param->getType();
if (T->isReferenceType())
- T = cast<ReferenceType>(T)->getPointeeType();
+ T = T->getAs<ReferenceType>()->getPointeeType();
Expr *rhs = new (Context) DeclRefExpr(Param, T,
VK_LValue, SourceLocation());
ExprResult Res = BuildBinOp(S, lhs->getLocEnd(),
OpenPOWER on IntegriCloud