rjmccall added inline comments.
================ Comment at: lib/CodeGen/CGExprConstant.cpp:1793 + "this boxed expression can't be emitted as a compile-time constant"); + return emitConstantObjCStringLiteral(cast<StringLiteral>(E->getSubExpr()), + E->getType(), CGM); ---------------- `IgnoreParens`. ================ Comment at: lib/Sema/SemaExprObjC.cpp:534 + NSStringPointer, NSStringPointer); + return new (Context) ObjCBoxedExpr(SL, BoxedType, nullptr, SR); + } ---------------- You're implicitly dropping sugar from the source expression here; I really think you should preserve that, and if it means you end up having to look through array-decay expressions, that's not the end of the world. The need for a special case here is just to allow us to compile these even if there isn't a boxing method available? Do you need to restrict the type of the string literal so that it doesn't apply to e.g. wide strings? Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58729/new/ https://reviews.llvm.org/D58729 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits