net-im/telegram-desktop: unbreak build on FreeBSD versions with base LLVM < 16
Minimal required LLVM version to build is 16 now.
It is stated on the clang release page, that the proposals for doing these kinds of captures are implemented in Clang16
Error example:
/wrkdirs/overlays/wip/net-im/telegram-desktop/work-qt5/tdesktop-4.14.4-full/Telegram/SourceFiles/window/window_session_controller.cpp
/wrkdirs/overlays/wip/net-im/telegram-desktop/work-qt5/tdesktop-4.14.4-full/Telegram/SourceFiles/window/window_session_controller.cpp:1249:9: error: reference to local binding 'index' declared in enclosing lambda expression
if (index >= list.size()) { ^
/wrkdirs/overlays/wip/net-im/telegram-desktop/work-qt5/tdesktop-4.14.4-full/Telegram/SourceFiles/window/window_session_controller.cpp:1246:29: note: 'index' declared here
for (const auto [command, index] : accounts) { ^
/wrkdirs/overlays/wip/net-im/telegram-desktop/work-qt5/tdesktop-4.14.4-full/Telegram/SourceFiles/window/window_session_controller.cpp:1252:31: error: reference to local binding 'index' declared in enclosing lambda expression
const auto account = list[index]; ^
/wrkdirs/overlays/wip/net-im/telegram-desktop/work-qt5/tdesktop-4.14.4-full/Telegram/SourceFiles/window/window_session_controller.cpp:1246:29: note: 'index' declared here
for (const auto [command, index] : accounts) { ^
2 errors generated.
Reported by: Benjamin Takacs <nimaje+fbz@bureaucracy.de>