[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:29:43 PST 2024


================
@@ -30371,24 +30372,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)
     {
----------------
hubert-reinterpretcast wrote:

```suggestion
    for (auto c_str : xfail_cases)
    {
        if (!c_str)
            break;
```

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


More information about the libcxx-commits mailing list