Index: clang/lib/AST/DeclPrinter.cpp =================================================================== --- clang/lib/AST/DeclPrinter.cpp +++ clang/lib/AST/DeclPrinter.cpp @@ -153,11 +153,14 @@ while (!BaseType->isSpecifierType()) { if (const PointerType *PTy = BaseType->getAs()) BaseType = PTy->getPointeeType(); + else if (const ObjCObjectPointerType *OPT = + BaseType->getAs()) + BaseType = OPT->getPointeeType(); else if (const BlockPointerType *BPy = BaseType->getAs()) BaseType = BPy->getPointeeType(); - else if (const ArrayType* ATy = dyn_cast(BaseType)) + else if (const ArrayType *ATy = dyn_cast(BaseType)) BaseType = ATy->getElementType(); - else if (const FunctionType* FTy = BaseType->getAs()) + else if (const FunctionType *FTy = BaseType->getAs()) BaseType = FTy->getReturnType(); else if (const VectorType *VTy = BaseType->getAs()) BaseType = VTy->getElementType(); Index: clang/lib/AST/Type.cpp =================================================================== --- clang/lib/AST/Type.cpp +++ clang/lib/AST/Type.cpp @@ -2785,7 +2785,6 @@ case DependentTemplateSpecialization: case ObjCInterface: case ObjCObject: - case ObjCObjectPointer: // FIXME: object pointers aren't really specifiers return true; default: return false; Index: clang/lib/AST/TypePrinter.cpp =================================================================== --- clang/lib/AST/TypePrinter.cpp +++ clang/lib/AST/TypePrinter.cpp @@ -310,7 +310,6 @@ SaveAndRestore PrevPHIsEmpty(HasEmptyPlaceHolder); // Print qualifiers as appropriate. - bool CanPrefixQualifiers = false; bool NeedARCStrongQualifier = false; CanPrefixQualifiers = canPrefixQualifiers(T, NeedARCStrongQualifier); Index: clang/unittests/AST/TypePrinterTest.cpp =================================================================== --- clang/unittests/AST/TypePrinterTest.cpp +++ clang/unittests/AST/TypePrinterTest.cpp @@ -62,4 +62,11 @@ ASSERT_TRUE(PrintedTypeMatches( Code, {}, Matcher, "const N::Type &", [](PrintingPolicy &Policy) { Policy.FullyQualifiedName = true; })); -} \ No newline at end of file +} + +TEST(TypePrinter, SpecifierType) { + + auto Qual = qualType().bind(ObjCObjectPointerType); + + ASSERT_TRUE(Qual.getTypePtr().isSpecifierType() == false); +}