std::string &S) {
std::string ObjCQIString;
+ T->getPointeeType().getLocalQualifiers().getAsStringInternal(ObjCQIString,
+ Policy);
+ if (!ObjCQIString.empty())
+ ObjCQIString += ' ';
+
if (T->isObjCIdType() || T->isObjCQualifiedIdType())
- ObjCQIString = "id";
+ ObjCQIString += "id";
else if (T->isObjCClassType() || T->isObjCQualifiedClassType())
- ObjCQIString = "Class";
+ ObjCQIString += "Class";
else if (T->isObjCSelType())
- ObjCQIString = "SEL";
+ ObjCQIString += "SEL";
else
- ObjCQIString = T->getInterfaceDecl()->getNameAsString();
+ ObjCQIString += T->getInterfaceDecl()->getNameAsString();
if (!T->qual_empty()) {
ObjCQIString += '<';
ObjCQIString += '>';
}
- T->getPointeeType().getLocalQualifiers().getAsStringInternal(ObjCQIString,
- Policy);
-
if (!T->isObjCIdType() && !T->isObjCQualifiedIdType())
ObjCQIString += " *"; // Don't forget the implicit pointer.
else if (!S.empty()) // Prefix the basic type, e.g. 'typedefname X'.
int main () {
- [@"Identifier1" isEqualToString:Identifier1]; // expected-warning {{sending 'NSString const *' to parameter of type 'NSString *' discards qualifiers}}
- [@"Identifier2" isEqualToString:Identifier2]; // expected-warning {{sending 'NSString const *' to parameter of type 'NSString *' discards qualifiers}}
+ [@"Identifier1" isEqualToString:Identifier1]; // expected-warning {{sending 'const NSString *' to parameter of type 'NSString *' discards qualifiers}}
+ [@"Identifier2" isEqualToString:Identifier2]; // expected-warning {{sending 'const NSString *' to parameter of type 'NSString *' discards qualifiers}}
[@"Identifier3" isEqualToString:Identifier3];
return 0;
}
- (void) Meth : (I*) Arg; // expected-note{{passing argument to parameter 'Arg' here}}
@end
-void Func (I* arg); // expected-note {{candidate function not viable: no known conversion from 'I const *' to 'I *' for 1st argument}}
+void Func (I* arg); // expected-note {{candidate function not viable: no known conversion from 'const I *' to 'I *' for 1st argument}}
void foo(const I *p, I* sel) {
- [sel Meth : p]; // expected-error {{cannot initialize a parameter of type 'I *' with an lvalue of type 'I const *'}}
+ [sel Meth : p]; // expected-error {{cannot initialize a parameter of type 'I *' with an lvalue of type 'const I *'}}
Func(p); // expected-error {{no matching function for call to 'Func'}}
}