summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2013-12-10 19:22:41 +0000
committerFariborz Jahanian <fjahanian@apple.com>2013-12-10 19:22:41 +0000
commit7c04a55545546dc6e59a006f7461a21e297f4d18 (patch)
tree5f9c3091ecf5080a57deae03ab535052518be063 /clang/test
parent765d2e234cb4502f0dabc8274fd5e78183943d7f (diff)
downloadbcm5719-llvm-7c04a55545546dc6e59a006f7461a21e297f4d18.tar.gz
bcm5719-llvm-7c04a55545546dc6e59a006f7461a21e297f4d18.zip
Improve on an objc_bridge_related diagnostic.
// rdar://15499111 llvm-svn: 196950
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/SemaObjC/arc-objcbridge-related-attribute.m10
-rw-r--r--clang/test/SemaObjC/objcbridge-related-attribute.m10
2 files changed, 10 insertions, 10 deletions
diff --git a/clang/test/SemaObjC/arc-objcbridge-related-attribute.m b/clang/test/SemaObjC/arc-objcbridge-related-attribute.m
index d78ee4dc4ed..d92c636da8d 100644
--- a/clang/test/SemaObjC/arc-objcbridge-related-attribute.m
+++ b/clang/test/SemaObjC/arc-objcbridge-related-attribute.m
@@ -25,9 +25,9 @@ NSColor * Test1(NSTextField *textField, CGColorRef newColor) {
}
NSColor * Test2(NSTextField *textField, CGColorRef1 newColor) {
- foo(newColor); // expected-error {{you can't convert 'CGColorRef1' (aka 'struct CGColor1 *') to 'NSColor *', without using an existing class method for this conversion}}
- textField.backgroundColor = newColor; // expected-error {{you can't convert 'CGColorRef1' (aka 'struct CGColor1 *') to 'NSColor *__strong', without using an existing class method for this conversion}}
- return newColor; // expected-error {{you can't convert 'CGColorRef1' (aka 'struct CGColor1 *') to 'NSColor *', without using an existing class method for this conversion}}
+ foo(newColor); // expected-error {{'CGColorRef1' (aka 'struct CGColor1 *') cannot be directly converted to 'NSColor *'; specify a class method in objc_bridge_related attribute for this conversion}}
+ textField.backgroundColor = newColor; // expected-error {{'CGColorRef1' (aka 'struct CGColor1 *') cannot be directly converted to 'NSColor *__strong'; specify a class method in objc_bridge_related attribute for this conversion}}
+ return newColor; // expected-error {{'CGColorRef1' (aka 'struct CGColor1 *') cannot be directly converted to 'NSColor *'; specify a class method in objc_bridge_related attribute for this conversion}}
}
CGColorRef Test3(NSTextField *textField, CGColorRef newColor) {
@@ -36,6 +36,6 @@ CGColorRef Test3(NSTextField *textField, CGColorRef newColor) {
}
CGColorRef2 Test4(NSTextField *textField, CGColorRef2 newColor) {
- newColor = textField.backgroundColor; // expected-error {{you can't convert 'NSColor *' to 'CGColorRef2' (aka 'struct CGColor2 *'), without using an existing instance method for this conversion}}
- return textField.backgroundColor; // expected-error {{you can't convert 'NSColor *' to 'CGColorRef2' (aka 'struct CGColor2 *'), without using an existing instance method for this conversion}}
+ newColor = textField.backgroundColor; // expected-error {{'NSColor *' cannot be directly converted to 'CGColorRef2' (aka 'struct CGColor2 *'); specify an instance method in objc_bridge_related attribute for this conversion}}
+ return textField.backgroundColor; // expected-error {{'NSColor *' cannot be directly converted to 'CGColorRef2' (aka 'struct CGColor2 *'); specify an instance method in objc_bridge_related attribute for this conversion}}
}
diff --git a/clang/test/SemaObjC/objcbridge-related-attribute.m b/clang/test/SemaObjC/objcbridge-related-attribute.m
index aa6db6f96ee..a6d5e2eb97f 100644
--- a/clang/test/SemaObjC/objcbridge-related-attribute.m
+++ b/clang/test/SemaObjC/objcbridge-related-attribute.m
@@ -25,9 +25,9 @@ NSColor * Test1(NSTextField *textField, CGColorRef newColor) {
}
NSColor * Test2(NSTextField *textField, CGColorRef1 newColor) {
- foo(newColor); // expected-error {{you can't convert 'CGColorRef1' (aka 'struct CGColor1 *') to 'NSColor *', without using an existing class method for this conversion}}
- textField.backgroundColor = newColor; // expected-error {{you can't convert 'CGColorRef1' (aka 'struct CGColor1 *') to 'NSColor *', without using an existing class method for this conversion}}
- return newColor; // expected-error {{you can't convert 'CGColorRef1' (aka 'struct CGColor1 *') to 'NSColor *', without using an existing class method for this conversion}}
+ foo(newColor); // expected-error {{'CGColorRef1' (aka 'struct CGColor1 *') cannot be directly converted to 'NSColor *'; specify a class method in objc_bridge_related attribute for this conversion}}
+ textField.backgroundColor = newColor; // expected-error {{'CGColorRef1' (aka 'struct CGColor1 *') cannot be directly converted to 'NSColor *'; specify a class method in objc_bridge_related attribute for this conversion}}
+ return newColor; // expected-error {{'CGColorRef1' (aka 'struct CGColor1 *') cannot be directly converted to 'NSColor *'; specify a class method in objc_bridge_related attribute for this conversion}}
}
CGColorRef Test3(NSTextField *textField, CGColorRef newColor) {
@@ -36,6 +36,6 @@ CGColorRef Test3(NSTextField *textField, CGColorRef newColor) {
}
CGColorRef2 Test4(NSTextField *textField, CGColorRef2 newColor) {
- newColor = textField.backgroundColor; // expected-error {{you can't convert 'NSColor *' to 'CGColorRef2' (aka 'struct CGColor2 *'), without using an existing instance method for this conversion}}
- return textField.backgroundColor; // expected-error {{you can't convert 'NSColor *' to 'CGColorRef2' (aka 'struct CGColor2 *'), without using an existing instance method for this conversion}}
+ newColor = textField.backgroundColor; // expected-error {{'NSColor *' cannot be directly converted to 'CGColorRef2' (aka 'struct CGColor2 *'); specify an instance method in objc_bridge_related attribute for this conversion}}
+ return textField.backgroundColor; // expected-error {{'NSColor *' cannot be directly converted to 'CGColorRef2' (aka 'struct CGColor2 *'); specify an instance method in objc_bridge_related attribute for this conversion}}
}
OpenPOWER on IntegriCloud