[llvm] [llvm][support] Fix DebugLogTest. (PR #150585)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 25 01:07:40 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-support

Author: Jacques Pienaar (jpienaar)

<details>
<summary>Changes</summary>

Fails on windows with error

C2466: cannot allocate an array of constant size 0

else.

---
Full diff: https://github.com/llvm/llvm-project/pull/150585.diff


1 Files Affected:

- (modified) llvm/unittests/Support/DebugLogTest.cpp (+1-1) 


``````````diff
diff --git a/llvm/unittests/Support/DebugLogTest.cpp b/llvm/unittests/Support/DebugLogTest.cpp
index 513699913f922..22dffd857613d 100644
--- a/llvm/unittests/Support/DebugLogTest.cpp
+++ b/llvm/unittests/Support/DebugLogTest.cpp
@@ -66,7 +66,7 @@ TEST(DebugLogTest, Basic) {
   // LDBG should be compiled out in NDEBUG, so just check it compiles and has
   // no effect.
   llvm::DebugFlag = true;
-  static const char *DT[] = {};
+  static const char *DT[] = {"A"};
   setCurrentDebugTypes(DT, 0);
   int count = 0;
   auto inc = [&]() { return ++count; };

``````````

</details>


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


More information about the llvm-commits mailing list