[PATCH] D58729: Emit boxed expression as a compile-time constant if the expression inside the parentheses is a string literal

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 6 19:12:56 PST 2019


rjmccall added inline comments.


================
Comment at: include/clang/Basic/DiagnosticGroups.td:322
 def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">;
+def InvalidUTF8String : DiagGroup<"invalid-utf8-string">;
 def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">;
----------------
I think this warning group should mention that this is specific to ObjC boxing somehow.


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:5807
   "Clang encodes unprefixed narrow string literals as UTF-8">;
+def warn_invalid_utf8_string : Warning<"invalid UTF-8 string">, InGroup<InvalidUTF8String>;
 def err_array_init_different_type : Error<
----------------
Maybe "string is ill-formed as UTF-8 and will become a null NSString* when boxed", where the type is whatever the type of the box-expression would be?


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D58729/new/

https://reviews.llvm.org/D58729





More information about the cfe-commits mailing list