"this patch adds code generation hooks for Objective-C constant strings. It also modifies Sema so that Objective-C constant strings are treated as untyped objects if the interface for the constant string class can not be found. This is consistent with Apple GCC. I thought it was consistent with GNU GCC, since this was causing failures when trying to compile GNUstep with (GNU) GCC, but it appears that this is not the case when attempting to produce a simple test case to demonstrate it. Possibly there is a way of making the error go away, but I haven't found out what it is yet."
Patch by David Chisnall!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52599 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Parser/objc-foreach-error-1.m b/test/Parser/objc-foreach-error-1.m
index 693f12e..76251ab 100644
--- a/test/Parser/objc-foreach-error-1.m
+++ b/test/Parser/objc-foreach-error-1.m
@@ -17,8 +17,7 @@
@implementation MyList (BasicTest) // expected-error {{cannot find interface declaration for 'MyList'}}
- (void)compilerTestAgainst {
MyList * el; // expected-error {{use of undeclared identifier 'MyList'}}
- for (el in @"foo") // expected-error {{use of undeclared identifier 'el'}} \
- // expected-error {{cannot find interface declaration for 'NSConstantString'}}
+ for (el in @"foo") // expected-error {{use of undeclared identifier 'el'}}
{ LOOP(); }
}
@end
diff --git a/test/Sema/missing-string-interface.m b/test/Sema/missing-string-interface.m
deleted file mode 100644
index f96fb4c..0000000
--- a/test/Sema/missing-string-interface.m
+++ /dev/null
@@ -1,7 +0,0 @@
-// RUN: clang %s -verify -fsyntax-only
-
-@class NSString;
-
-// GCC considers this an error, so clang will...
-NSString *s = @"123"; // expected-error: {{cannot find interface declaration for 'NSConstantString'}}
-
diff --git a/test/Sema/objc-property-8.m b/test/Sema/objc-property-8.m
index a081f39..8ca0afc 100644
--- a/test/Sema/objc-property-8.m
+++ b/test/Sema/objc-property-8.m
@@ -68,7 +68,7 @@
@synthesize query = _query;
- (void) _clearQuery
{
- [self.query removeObserver: self forKeyPath: @"matches"]; // expected-error{{cannot find interface declaration for 'NSConstantString'}}
+ [self.query removeObserver: self forKeyPath: @"matches"];
}
@end