summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/AST/ASTContext.cpp8
-rw-r--r--clang/lib/Sema/SemaType.cpp3
2 files changed, 7 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp
index e091bf10b62..d8c1c848582 100644
--- a/clang/lib/AST/ASTContext.cpp
+++ b/clang/lib/AST/ASTContext.cpp
@@ -2240,14 +2240,16 @@ static void SortAndUniqueProtocols(ObjCProtocolDecl **Protocols,
/// the given interface decl and the conforming protocol list.
QualType ASTContext::getObjCObjectPointerType(QualType InterfaceT,
ObjCProtocolDecl **Protocols,
- unsigned NumProtocols) {
+ unsigned NumProtocols,
+ unsigned Quals) {
llvm::FoldingSetNodeID ID;
ObjCObjectPointerType::Profile(ID, InterfaceT, Protocols, NumProtocols);
+ Qualifiers Qs = Qualifiers::fromCVRMask(Quals);
void *InsertPos = 0;
if (ObjCObjectPointerType *QT =
ObjCObjectPointerTypes.FindNodeOrInsertPos(ID, InsertPos))
- return QualType(QT, 0);
+ return getQualifiedType(QualType(QT, 0), Qs);
// Sort the protocol list alphabetically to canonicalize it.
QualType Canonical;
@@ -2282,7 +2284,7 @@ QualType ASTContext::getObjCObjectPointerType(QualType InterfaceT,
Types.push_back(QType);
ObjCObjectPointerTypes.InsertNode(QType, InsertPos);
- return QualType(QType, 0);
+ return getQualifiedType(QualType(QType, 0), Qs);
}
/// getObjCInterfaceType - Return the unique reference to the type for the
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 2fb5c84ac90..a79853afdc6 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -1034,7 +1034,8 @@ QualType Sema::GetTypeForDeclarator(Declarator &D, Scope *S,
const ObjCInterfaceType *OIT = T->getAs<ObjCInterfaceType>();
T = Context.getObjCObjectPointerType(T,
(ObjCProtocolDecl **)OIT->qual_begin(),
- OIT->getNumProtocols());
+ OIT->getNumProtocols(),
+ DeclType.Ptr.TypeQuals);
break;
}
T = BuildPointerType(T, DeclType.Ptr.TypeQuals, DeclType.Loc, Name);
OpenPOWER on IntegriCloud