[PATCH] D28473: Implement http://wg21.link/P0426 Constexpr for std::char_traits

Richard Smith via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 9 11:52:34 PST 2017


rsmith added inline comments.


================
Comment at: include/__string:248
+#if _LIBCPP_STD_VER <= 14
+    return (const char_type*) memchr(__s, to_int_type(__a), __n);
+#else
----------------
We can add another builtin to Clang to support this case if you'd like.  (There's also a way to get `__builtin_memchr` to work here using a `__builtin_constant_p` conditional expression to enable constant folding -- http://melpon.org/wandbox/permlink/0ob1n4a3zv1Kt3Ds -- but from discussion on IRC it sounds like Marshall is not happy about that approach.)


https://reviews.llvm.org/D28473





More information about the cfe-commits mailing list