[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:44 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)
{
int status;
- char* demang = __cxxabiv1::__cxa_demangle(xfail_cases[i], buf, &len, &status);
+ char* demang = __cxxabiv1::__cxa_demangle(*it, buf, &len, &status);
if (status != -2)
{
- std::printf("%s was documented as xfail but passed\n", xfail_cases[i]);
+ std::printf("%s was documented as xfail but passed\n", *it);
----------------
hubert-reinterpretcast wrote:
```suggestion
std::printf("%s was documented as xfail but passed\n", c_str);
```
https://github.com/llvm/llvm-project/pull/114882
More information about the libcxx-commits
mailing list