From 0701faae46e253f93c583c1f4d7a325a7ecd20c5 Mon Sep 17 00:00:00 2001 From: Peter Barnes Date: Tue, 17 Sep 2024 15:03:15 +0000 Subject: [PATCH] doc: pid: (fixes #1142) refactor lambda with structured binding --- utils/print-introspected-doxygen.cc | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/utils/print-introspected-doxygen.cc b/utils/print-introspected-doxygen.cc index 99004045f..1f7cec447 100644 --- a/utils/print-introspected-doxygen.cc +++ b/utils/print-introspected-doxygen.cc @@ -837,10 +837,12 @@ PrintAttributesTid(std::ostream& os, const TypeId tid) } bool moreFlags{false}; os << " " << listLineStart << "Flags: "; - auto flagWrite = [&os, &moreFlags, info](TypeId::AttributeFlag flag, - bool hasFunc, - std::string msg) -> void { - if (info.flags & flag && hasFunc) + + auto myInfo = info; // See GitLab #1142 + auto flagWrite = [&os, &moreFlags, myInfo](TypeId::AttributeFlag flag, + bool hasFunc, + std::string msg) -> void { + if (myInfo.flags & flag && hasFunc) { os << (outputText && moreFlags ? ", " : "") << flagSpanStart << msg << flagSpanStop; moreFlags = true;