[clang-tools-extra] 3106698 - [clang-doc][nfc] Avoid combining constexpr with std::initializer_list as this seems to give MSVC trouble. (#199311)
via cfe-commits
cfe-commits at lists.llvm.org
Sat May 23 06:13:14 PDT 2026
Author: Wolfgang Pieb
Date: 2026-05-23T09:13:09-04:00
New Revision: 3106698fcd17513bc05ecc93a173f43bb71666f3
URL: https://github.com/llvm/llvm-project/commit/3106698fcd17513bc05ecc93a173f43bb71666f3
DIFF: https://github.com/llvm/llvm-project/commit/3106698fcd17513bc05ecc93a173f43bb71666f3.diff
LOG: [clang-doc][nfc] Avoid combining constexpr with std::initializer_list as this seems to give MSVC trouble. (#199311)
Some Windows bots using MSVC 2019 and 2022 get assertion errors in the
clang-doc lit tests (see
[here](https://github.com/llvm/llvm-project/pull/198066). This seems to
be due to MSVC having trouble with a correctly initializing structures
using std::initializer_list when embedded in a struct declared with
constexpr.
This workaround changes constexpr to const in a struct definition to
avoid this issue.
Added:
Modified:
clang-tools-extra/clang-doc/BitcodeWriter.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clang-doc/BitcodeWriter.cpp b/clang-tools-extra/clang-doc/BitcodeWriter.cpp
index f8431a44ec533..2ab1bbf4a8a16 100644
--- a/clang-tools-extra/clang-doc/BitcodeWriter.cpp
+++ b/clang-tools-extra/clang-doc/BitcodeWriter.cpp
@@ -252,7 +252,7 @@ struct BlockToIdList {
std::initializer_list<RecordId> RIDs;
};
-static constexpr BlockToIdList RecordsByBlock[] = {
+static const BlockToIdList RecordsByBlock[] = {
// Version Block
{BI_VERSION_BLOCK_ID, {VERSION}},
// Comment Block
More information about the cfe-commits
mailing list