Skip to content

Conversation

@andrey-golubev
Copy link
Contributor

Historically, MSVC would issue a warning seeing a brace-enclosed initializer list variable being used as a range. A quick fix is to use a C-style array instead which is more or less an equivalent form.

Unfortunately, a lot of time has passed since this patch was originally added to our downstream. Thus, the original warning is long lost. The patch is trivial and harmless enough to be applied nonetheless.

… list

Historically, MSVC would issue a warning seeing a brace-enclosed
initializer list variable being used as a range. A quick fix is to use a
C-style array instead which is more or less an equivalent form.

Unfortunately, a lot of time has passed since this patch was originally
added to our downstream. Thus, the original warning is long lost.
The patch is trivial and harmless enough to be applied nonetheless.

Co-authored-by: Jörn Schöndube <jorn.schondube@intel.com>
@llvmbot
Copy link
Member

llvmbot commented Nov 10, 2025

@llvm/pr-subscribers-debuginfo

Author: Andrei Golubev (andrey-golubev)

Changes

Historically, MSVC would issue a warning seeing a brace-enclosed initializer list variable being used as a range. A quick fix is to use a C-style array instead which is more or less an equivalent form.

Unfortunately, a lot of time has passed since this patch was originally added to our downstream. Thus, the original warning is long lost. The patch is trivial and harmless enough to be applied nonetheless.


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

1 Files Affected:

  • (modified) llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp (+2-2)
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
index 693454e249945..440ad4f1268c7 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFVerifier.cpp
@@ -1523,8 +1523,8 @@ void DWARFVerifier::verifyNameIndexAttribute(
   }
 
   if (AttrEnc.Index == dwarf::DW_IDX_parent) {
-    constexpr static auto AllowedForms = {dwarf::Form::DW_FORM_flag_present,
-                                          dwarf::Form::DW_FORM_ref4};
+    constexpr static dwarf::Form AllowedForms[] = {
+        dwarf::Form::DW_FORM_flag_present, dwarf::Form::DW_FORM_ref4};
     if (!is_contained(AllowedForms, AttrEnc.Form)) {
       ErrorCategory.Report("Unexpected NameIndex Abbreviation", [&]() {
         error() << formatv(

@andrey-golubev
Copy link
Contributor Author

Gentle ping.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants