summaryrefslogtreecommitdiffstats
path: root/test/SemaObjC/boxing-illegal.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/boxing-illegal.m')
-rw-r--r--test/SemaObjC/boxing-illegal.m15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/SemaObjC/boxing-illegal.m b/test/SemaObjC/boxing-illegal.m
index 59b5c8b710..4493819288 100644
--- a/test/SemaObjC/boxing-illegal.m
+++ b/test/SemaObjC/boxing-illegal.m
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -fsyntax-only -verify -Wattributes %s
+// RUN: %clang_cc1 -fsyntax-only -verify -Wattributes -fpascal-strings %s
typedef long NSInteger;
typedef unsigned long NSUInteger;
@@ -57,6 +57,19 @@ void testEnum(void *p) {
box = @(*(enum ForwE*)p); // expected-error {{incomplete type 'enum ForwE' used in a boxed expression}}
}
+@interface NSString
+@end
+
+void testStringLiteral() {
+ NSString *s;
+ s = @("abc");
+ s = @(u8"abc");
+ s = @(u"abc"); // expected-error {{illegal type 'unsigned short *' used in a boxed expression}}
+ s = @(U"abc"); // expected-error {{illegal type 'unsigned int *' used in a boxed expression}}
+ s = @(L"abc"); // expected-error-re {{illegal type {{.*}} used in a boxed expression}}
+ s = @("\pabc"); // expected-error {{illegal type 'unsigned char *' used in a boxed expression}}
+}
+
// rdar://13333205
@class NSMutableDictionary;