From e819c15b47b4ffff1df611c8a919e1063d2a8c11 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Wed, 5 Mar 2014 06:47:57 +0000 Subject: [PATCH] [AST] A "Class

" type should not have '*' when printed out. rdar://14309030 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202941 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/TypePrinter.cpp | 4 +++- test/Index/complete-method-decls.m | 11 +++++++++++ test/SemaObjC/compare-qualified-class.m | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/AST/TypePrinter.cpp b/lib/AST/TypePrinter.cpp index e323cad0a6..9630ecd357 100644 --- a/lib/AST/TypePrinter.cpp +++ b/lib/AST/TypePrinter.cpp @@ -1302,7 +1302,9 @@ void TypePrinter::printObjCObjectPointerBefore(const ObjCObjectPointerType *T, OS << '>'; } - if (!T->isObjCIdType() && !T->isObjCQualifiedIdType()) { + if (!T->isObjCIdType() && !T->isObjCQualifiedIdType() && + !T->isObjCClassType() && !T->isObjCQualifiedClassType() && + !T->isObjCSelType()) { OS << " *"; // Don't forget the implicit pointer. } else { spaceBeforePlaceHolder(OS); diff --git a/test/Index/complete-method-decls.m b/test/Index/complete-method-decls.m index 9e52d93e57..ce2f4dc0d5 100644 --- a/test/Index/complete-method-decls.m +++ b/test/Index/complete-method-decls.m @@ -72,6 +72,14 @@ - (oneway void)method:(in id x) {} @end +@interface I1 +-(Class)meth; +@end + +@implementation I1 +- +@end + // RUN: c-index-test -code-completion-at=%s:17:3 %s | FileCheck -check-prefix=CHECK-CC1 %s // CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text id}{RightParen )}{TypedText abc} (40) // CHECK-CC1: ObjCInstanceMethodDecl:{LeftParen (}{Text int}{RightParen )}{TypedText getInt} (40) @@ -182,3 +190,6 @@ // RUN: c-index-test -code-completion-at=%s:72:2 %s | FileCheck -check-prefix=CHECK-ONEWAY %s // CHECK-ONEWAY: ObjCInstanceMethodDecl:{LeftParen (}{Text oneway }{Text void}{RightParen )}{TypedText method}{TypedText :}{LeftParen (}{Text in }{Text id}{RightParen )}{Text x} (40) + +// RUN: c-index-test -code-completion-at=%s:80:2 %s | FileCheck -check-prefix=CHECK-CLASSTY %s +// CHECK-CLASSTY: ObjCInstanceMethodDecl:{LeftParen (}{Text Class}{RightParen )}{TypedText meth} diff --git a/test/SemaObjC/compare-qualified-class.m b/test/SemaObjC/compare-qualified-class.m index 0f415b607d..60ef851e1f 100644 --- a/test/SemaObjC/compare-qualified-class.m +++ b/test/SemaObjC/compare-qualified-class.m @@ -25,6 +25,6 @@ int main () { return classA == classB || classA == classC || classC == classA || - classA == classD; // expected-warning {{comparison of distinct pointer types ('Class *' and 'Class *')}} + classA == classD; // expected-warning {{comparison of distinct pointer types ('Class' and 'Class')}} } -- 2.40.0