[libcxx-commits] [libcxxabi] [llvm] [libc++abi] Enable demangling of `cp` expression production (PR #114882)

Hubert Tong via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 5 19:38:00 PST 2024


================
@@ -30397,24 +30398,22 @@ void test_invalid_cases()
     assert(!passed && "demangle did not fail");
 }
 
-const char *xfail_cases[] = {
-    // FIXME: Why does clang generate the "cp" expr?
-    "_ZN5test11bIsEEDTcp3foocvT__EEES1_",
+const char *const xfail_cases[] = {
+    // Sentinel value
+    nullptr
 };
 
-const size_t num_xfails = sizeof(xfail_cases) / sizeof(xfail_cases[0]);
-
 void test_xfail_cases()
 {
     std::size_t len = 0;
     char* buf = nullptr;
-    for (std::size_t i = 0; i < num_xfails; ++i)
+    for (const char* const* it = xfail_cases; *it; ++it)
     {
         int status;
-        char* demang = __cxxabiv1::__cxa_demangle(xfail_cases[i], buf, &len, &status);
+        char* demang = __cxxabiv1::__cxa_demangle(*it, buf, &len, &status);
----------------
hubert-reinterpretcast wrote:

```suggestion
        char* demang = __cxxabiv1::__cxa_demangle(c_str, buf, &len, &status);
```

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


More information about the libcxx-commits mailing list