[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
Mon Mar 4 22:12:03 PST 2019


rjmccall added inline comments.


================
Comment at: test/SemaObjC/boxing-illegal.m:70
+  s = @(L"abc"); // expected-error {{illegal type 'int *' used in a boxed expression}}
+  s = @("\pabc"); // expected-error {{illegal type 'unsigned char *' used in a boxed expression}}
+}
----------------
I don't know what `\p` is supposed to be or why it apparently changes the type of the literal to `unsigned char *`, but none of these are ordinary string literals that are invalid as UTF-8.  I mean something like "\xFF", which still has type `char *` but will fail to parse as UTF-8, which will cause normal boxing to fail and return `nil`.


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