[clang] [llvm] [DebugInfo] Emit DW_AT_const_value for constexpr array static members (PR #182442)

Michael Buch via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 20 06:31:53 PST 2026


Michael137 wrote:

I'd be curious of the use-case. LLDB seems to be able to read the contents of the static just fine (even at `-O3`):
```
struct Test {
static inline constexpr char TEST[] = "Test String";
};

int main() {
    __builtin_printf("%s", Test::TEST);
    __builtin_debugtrap();
}
```

```
warning: a.out was compiled with optimization - stepping may behave oddly; variables may not be available.
(lldb) v Test::TEST
(const char[12]) Test::TEST = "Test String"
```

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


More information about the cfe-commits mailing list