From 89a28b5c08167f70fbc0909be8e2cb27cad519eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Micha=C3=ABl=20Celerier?= Date: Sun, 9 Aug 2026 18:59:17 -0400 Subject: [PATCH] cmake: raise Clang's expression nesting limit Clang caps expression nesting at 256. Avendish assembles the module list with std::tuple_cat, and libstdc++'s tuple constructor folds over every element: explicit(!(__is_implicitly_default_constructible_v<_Elements> && ...)) giving one term per module. Once the count passes 256 that stops being a diagnostic and becomes a hard error: tuple:965: fatal error: instantiating fold expression with 330 arguments exceeded expression nesting limit It is at 330 today and only grows as plug-ins are added, so this raises the ceiling well clear rather than to the next value above the current count. Costs nothing when the limit is not reached, and GCC has no equivalent cap. --- cmake/ScoreConfiguration.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmake/ScoreConfiguration.cmake b/cmake/ScoreConfiguration.cmake index 333ab25797..32734d202c 100644 --- a/cmake/ScoreConfiguration.cmake +++ b/cmake/ScoreConfiguration.cmake @@ -112,6 +112,8 @@ set(CMAKE_ANDROID_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Android") if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") set(CXX_IS_CLANG True) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fbracket-depth=1024") + if(("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL "16") AND ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "20") AND LLVM_LIBCXX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexperimental-library") elseif(APPLE)