[cfe-commits] r161291 - in /cfe/trunk: lib/AST/ExprConstant.cpp test/SemaObjC/unused.m

Fariborz Jahanian fjahanian at apple.com
Fri Aug 3 18:24:33 PDT 2012


Author: fjahanian
Date: Fri Aug  3 20:24:33 2012
New Revision: 161291

URL: http://llvm.org/viewvc/llvm-project?rev=161291&view=rev
Log:
objective-C string literal has no side-effect,
resulting in issuance of unused static variable
warning now. // rdar://10777111

Modified:
    cfe/trunk/lib/AST/ExprConstant.cpp
    cfe/trunk/test/SemaObjC/unused.m

Modified: cfe/trunk/lib/AST/ExprConstant.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprConstant.cpp?rev=161291&r1=161290&r2=161291&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprConstant.cpp (original)
+++ cfe/trunk/lib/AST/ExprConstant.cpp Fri Aug  3 20:24:33 2012
@@ -2315,6 +2315,7 @@
   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; }

Modified: cfe/trunk/test/SemaObjC/unused.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/unused.m?rev=161291&r1=161290&r2=161291&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/unused.m (original)
+++ cfe/trunk/test/SemaObjC/unused.m Fri Aug  3 20:24:33 2012
@@ -51,3 +51,5 @@
 }
 @end
 
+// rdar://10777111
+static NSString *x = @"hi"; // expected-warning {{unused variable 'x'}}





More information about the cfe-commits mailing list