[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
Tue Mar 3 01:34:37 PST 2026


================
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -std=c++17 -emit-llvm \
+// RUN:   -debug-info-kind=standalone -o - %s | FileCheck %s
+
+struct Test {
+  static inline constexpr char STR[] = "Hello";
+  static inline constexpr int NUMS[] = {1, 2, 3};
+  static inline constexpr unsigned char BYTES[] = {0xDE, 0xAD};
----------------
Michael137 wrote:

We need tests for the other bit-widths too.

I'd like to see:
1. `uint16_t`
1. `uint32_t`
2. `uint64_t`

Then for cases it doesn't work:
1. `float`
2. `double`
3. `int128_t` (or some variant thereof)

Also a test-case with arrays of negative integers would be good

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


More information about the cfe-commits mailing list