aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2012-08-04 01:24:33 +0000
committerFariborz Jahanian <fjahanian@apple.com>2012-08-04 01:24:33 +0000
commitb34eb0c6f0ea24047ad2439825b4f6348e380315 (patch)
treec6168b54cb1bb08947fc68f2417aa106254c7449
parenta8695180217806bb421cfc6700bec76fc0b1ae56 (diff)
objective-C string literal has no side-effect,
resulting in issuance of unused static variable warning now. // rdar://10777111 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161291 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/ExprConstant.cpp1
-rw-r--r--test/SemaObjC/unused.m2
2 files changed, 3 insertions, 0 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index cbcd5e8f74..48131f940a 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -2315,6 +2315,7 @@ public:
bool VisitIntegerLiteral(const IntegerLiteral *E) { return false; }
bool VisitFloatingLiteral(const FloatingLiteral *E) { return false; }
bool VisitStringLiteral(const StringLiteral *E) { return false; }
+ bool VisitObjCStringLiteral(const ObjCStringLiteral *E) { return false; }
bool VisitCharacterLiteral(const CharacterLiteral *E) { return false; }
bool VisitUnaryExprOrTypeTraitExpr(const UnaryExprOrTypeTraitExpr *E)
{ return false; }
diff --git a/test/SemaObjC/unused.m b/test/SemaObjC/unused.m
index 975b9a96a7..5c7542bf47 100644
--- a/test/SemaObjC/unused.m
+++ b/test/SemaObjC/unused.m
@@ -51,3 +51,5 @@ void test2() {
}
@end
+// rdar://10777111
+static NSString *x = @"hi"; // expected-warning {{unused variable 'x'}}