Even though it inherits from StringRef, we need to mention it
explicitly, as the formatter selection mechanism does not take
inheritance into account.
Details
Diff Detail
- Build Status
Buildable 3927 Build 3927: arc lint + arc unit
Event Timeline
include/llvm/Support/FormatProviders.h | ||
---|---|---|
49–50 | Perhaps this should use "is_convertible" which would match the implementation (well, not quite - the implementation should probably use "StringRef S = V" rather than StringRef S(V))? |
include/llvm/Support/FormatProviders.h | ||
---|---|---|
49–50 | If it works I'm all for simplifying. Need to be careful with potentially overlapping conditions though. |
Using is_convertible will work right now. What will this prevent is someone
defining their own format_provider on a class which has a conversion operator
for StringRef. I've debated this with myself a bit. On one hand, it adds more
predictability (if something behaves enough like StringRef that in can be
converted to one, it should also be formatted like it). On the other hand, I'm
sure somebody somewhere will invent a case where it still makes sense to do
that.
But I suppose we can cross that bridge when we come to it.
Perhaps this should use "is_convertible" which would match the implementation (well, not quite - the implementation should probably use "StringRef S = V" rather than StringRef S(V))?