summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTContext.cpp3
-rw-r--r--clang/lib/Sema/SemaExpr.cpp9
2 files changed, 6 insertions, 6 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index c5441dd3041..c656d966db3 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -2469,7 +2469,8 @@ bool ASTContext::isObjCObjectPointerType(QualType Ty) const {
// Check to see if this is 'id' or 'Class', both of which are typedefs for
// pointer types. This looks for the typedef specifically, not for the
// underlying type.
- if (Ty == getObjCIdType() || Ty == getObjCClassType())
+ if (Ty.getUnqualifiedType() == getObjCIdType() ||
+ Ty.getUnqualifiedType() == getObjCClassType())
return true;
// If this a pointer to an interface (e.g. NSString*), it is ok.
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 079ff74d795..3220a9e4619 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -932,15 +932,14 @@ Sema::ActOnDeclarationNameExpr(Scope *S, SourceLocation Loc,
// Blocks that have these can't be constant.
CurBlock->hasBlockDeclRefExprs = true;
+ QualType ExprTy = VD->getType().getNonReferenceType();
// The BlocksAttr indicates the variable is bound by-reference.
if (VD->getAttr<BlocksAttr>())
- return Owned(new (Context) BlockDeclRefExpr(VD,
- VD->getType().getNonReferenceType(), Loc, true));
+ return Owned(new (Context) BlockDeclRefExpr(VD, ExprTy, Loc, true));
// Variable will be bound by-copy, make it const within the closure.
- VD->getType().addConst();
- return Owned(new (Context) BlockDeclRefExpr(VD,
- VD->getType().getNonReferenceType(), Loc, false));
+ ExprTy.addConst();
+ return Owned(new (Context) BlockDeclRefExpr(VD, ExprTy, Loc, false));
}
// If this reference is not in a block or if the referenced variable is
// within the block, create a normal DeclRefExpr.
OpenPOWER on IntegriCloud