Diagnostics: Ensure state is initialized

Tweak how we define the storage type for diagnostic state to ensure that
the memory is always initialized.
This commit is contained in:
Matthew Woehlke committed 2026-05-07 17:09:29 -04:00
1 parent 46410ea189
commit 0556d1cfe9
3 files changed
+7 -1

No files matched your search

+5 -1
View File
@@ -101,7 +101,11 @@ public:
cm::string_view name);
/** Represent a set of diagnostic category actions. */
using DiagnosticMap = std::array<DiagnosticAction, CategoryCount>;
struct DiagnosticMap : public std::array<DiagnosticAction, CategoryCount>
{
DiagnosticMap()
: array{} {};
};
};
using cmDiagnosticCategory = cmDiagnostics::DiagnosticCategory;
+1
View File
@@ -5,6 +5,7 @@
#include "cmMakefile.h"
#include <algorithm>
#include <array>
#include <cassert>
#include <cstdio>
#include <cstdlib>
+1
View File
@@ -3,6 +3,7 @@
#include "cmMessenger.h"
#include <algorithm>
#include <array>
#include <sstream>
#include <utility>