[PATCH] D24904: Allow StringRef to be constructed with a null pointer

Mehdi AMINI via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 26 11:06:11 PDT 2016


mehdi_amini added a comment.

> Marking the `const char *` constructor explicit means you won't be able to write `foo("Test")` anymore, which would be really unfortunate.  There might be a way to hack around it with some overload / template magic, but I tried and couldn't get it to work.


I have a patch that does that (adding the template ctor for string literal), and I'm updating the LLVM codebase locally before submitting.


https://reviews.llvm.org/D24904





More information about the llvm-commits mailing list