[clang] Add support for builtin_verbose_trap (PR #79230)
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 22 14:31:51 PDT 2024
================
@@ -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");
----------------
dwblaikie wrote:
FWIW, I've seen multiple MB symbol names :) so I probably wouldn't be too worried that any user would write a description that's longer than the symbols that complex templates can create...
https://github.com/llvm/llvm-project/pull/79230
More information about the cfe-commits
mailing list