r202941 - [AST] A "Class<P>" type should not have '*' when printed out.
Argyrios Kyrtzidis
akyrtzi at gmail.com
Tue Mar 4 22:47:58 PST 2014
Author: akirtzidis
Date: Wed Mar 5 00:47:57 2014
New Revision: 202941
URL: http://llvm.org/viewvc/llvm-project?rev=202941&view=rev
Log:
[AST] A "Class<P>" type should not have '*' when printed out.
rdar://14309030
Modified:
cfe/trunk/lib/AST/TypePrinter.cpp
cfe/trunk/test/Index/complete-method-decls.m
cfe/trunk/test/SemaObjC/compare-qualified-class.m
Modified: cfe/trunk/lib/AST/TypePrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/TypePrinter.cpp?rev=202941&r1=202940&r2=202941&view=diff
==============================================================================
--- cfe/trunk/lib/AST/TypePrinter.cpp (original)
+++ cfe/trunk/lib/AST/TypePrinter.cpp Wed Mar 5 00:47:57 2014
@@ -1302,7 +1302,9 @@ void TypePrinter::printObjCObjectPointer
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);
Modified: cfe/trunk/test/Index/complete-method-decls.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/complete-method-decls.m?rev=202941&r1=202940&r2=202941&view=diff
==============================================================================
--- cfe/trunk/test/Index/complete-method-decls.m (original)
+++ cfe/trunk/test/Index/complete-method-decls.m Wed Mar 5 00:47:57 2014
@@ -72,6 +72,14 @@
- (oneway void)method:(in id x) {}
@end
+ at interface I1
+-(Class<P1>)meth;
+ at end
+
+ at implementation I1
+-
+ at 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<P1>}{RightParen )}{TypedText meth}
Modified: cfe/trunk/test/SemaObjC/compare-qualified-class.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/compare-qualified-class.m?rev=202941&r1=202940&r2=202941&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/compare-qualified-class.m (original)
+++ cfe/trunk/test/SemaObjC/compare-qualified-class.m Wed Mar 5 00:47:57 2014
@@ -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>')}}
}
More information about the cfe-commits
mailing list