================ @@ -0,0 +1,28 @@ +// RUN: %clang_cc1 -std=c++11 -fsyntax-only -fcxx-exceptions -verify %s + +#if !__has_builtin(__builtin_verbose_trap) +#error +#endif + +constexpr char const* constMsg1 = "hello"; +char const* const constMsg2 = "hello"; +char const constMsg3[] = "hello"; + +template <const char * const str> +void f(const char * arg) { + __builtin_verbose_trap("Argument_must_not_be_null"); ---------------- ahatanak wrote:
@pogo59, it looks like it's possible to overload builtins using templates in `clang/Basic/Builtins.td` as you said (for example, see `SyncFetchAndAddN`). However, 1. `char8_t` for builtin types isn't currently supported. We'll need to fix a few places in clang including tablegen to support that type. 2. It seems that the overloaded builtin will need a suffix (e.g., `_u8`) to distinguish it from the original one. I think we can try to add support for that in a follow up patch unless it's something we need now. https://github.com/llvm/llvm-project/pull/79230 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits