[PATCH] Extend -Wstring-conversion to catch NSString* to bool conversion

Jordan Rose jordan_rose at apple.com
Fri Jan 24 18:11:05 PST 2014


  Besides strings, anything on this page: http://clang.llvm.org/docs/ObjectiveCLiterals.html

  That corresponds to ObjCStringLiteral, ObjCBoxedExpr, ObjCArrayLiteral, and ObjCDictionaryLiteral...but //not// ObjCBoolLiteral (which is just `__objc_yes` and `__objc_no`). -Wobjc-literal-conversion, perhaps?

  (I suppose you could throw ObjCSelectorExpr in there as well, though that one probably deserves custom text; the others are all "Objective-C object literals". ObjCEncodeExpr just expands to a C string, so that could go under -Wstring-conversion if you cared.)

http://llvm-reviews.chandlerc.com/D2608



More information about the cfe-commits mailing list