]> granicus.if.org Git - clang/commitdiff
[AST] A "Class<P>" type should not have '*' when printed out.
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 5 Mar 2014 06:47:57 +0000 (06:47 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Wed, 5 Mar 2014 06:47:57 +0000 (06:47 +0000)
rdar://14309030

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202941 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/TypePrinter.cpp
test/Index/complete-method-decls.m
test/SemaObjC/compare-qualified-class.m

index e323cad0a6c765fbd05fca709e808f0b2412141b..9630ecd3574d191c1c63528f2e9bc68606328ccc 100644 (file)
@@ -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);
index 9e52d93e5701763cbeb67fe3f001e055c01f9d86..ce2f4dc0d59f75615a497c5fa4f0e83a2e1af15c 100644 (file)
 - (oneway void)method:(in id x) {}
 @end
 
+@interface I1
+-(Class<P1>)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)
 
 // 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<P1>}{RightParen )}{TypedText meth}
index 0f415b607dd72c08e3238c9b3f3af38d9b24c5b8..60ef851e1f3f9549bb10a40572a8259295f84ae3 100644 (file)
@@ -25,6 +25,6 @@ int main () {
     
     return classA == classB  || classA == classC ||
            classC == classA ||
-           classA == classD; // expected-warning {{comparison of distinct pointer types ('Class<SomeProtocol> *' and 'Class<SomeProtocol1> *')}}
+           classA == classD; // expected-warning {{comparison of distinct pointer types ('Class<SomeProtocol>' and 'Class<SomeProtocol1>')}}
 }