[libcxx-commits] [libcxxabi] [llvm] [ItaniumDemangle] Set `InConstraintExpr` to `true` when demangling a constraint expression (PR #107385)

Michael Buch via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 11 09:04:46 PDT 2024


================
@@ -30290,124 +30305,106 @@ const char* invalid_cases[] =
 
 const unsigned NI = sizeof(invalid_cases) / sizeof(invalid_cases[0]);
 
-void test()
-{
-    std::size_t len = 0;
-    char* buf = nullptr;
-    bool failed = false;
-    for (unsigned i = 0; i < N; ++i)
-    {
-        int status;
-        char* demang =
-            __cxxabiv1::__cxa_demangle(cases[i][0], buf, &len, &status);
-        if (!demang || std::strcmp(demang, cases[i][1]) != 0)
-        {
-          std::fprintf(stderr, "ERROR demangling %s\n"
-                       "expected: %s\n"
-                       "got: %d,   %s\n",
-                       cases[i][0], cases[i][1], status,
-                       demang ? demang : "(null)");
-          failed = true;
-        }
-        if (demang)
-          buf = demang;
+void test() {
----------------
Michael137 wrote:

Minor nit: can we clang-format this file separately? And also put a `// clang-format off` around the `invalid_cases` (like we do for the `cases` array). It's easier to copy-paste out the test-cases when they're not split across multiple lines

https://github.com/llvm/llvm-project/pull/107385


More information about the libcxx-commits mailing list