From: Fariborz Jahanian Date: Sat, 4 Aug 2012 01:24:33 +0000 (+0000) Subject: objective-C string literal has no side-effect, X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b34eb0c6f0ea24047ad2439825b4f6348e380315;p=clang 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 --- 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'}}