/// given interface decl and the conforming protocol list.
QualType getObjCObjectPointerType(QualType OIT,
ObjCProtocolDecl **ProtocolList = 0,
- unsigned NumProtocols = 0);
+ unsigned NumProtocols = 0,
+ unsigned Quals = 0);
/// getTypeOfType - GCC extension.
QualType getTypeOfExprType(Expr *e);
/// 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;
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
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);
@interface A(Cat)<P> @end // expected-note {{previous definition is here}}
@interface A(Cat)<Q> @end // expected-warning {{duplicate definition of category 'Cat' on interface 'A'}}
+
+// rdar 7626768
+@class NSString;
+NSString * TestBaz; // expected-note {{previous definition is here}}
+NSString * const TestBaz; // expected-error {{redefinition of 'TestBaz' with a different type}}