Skip to content

Commit c189cd0

Browse files
committed
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.
1 parent 44f21d1 commit c189cd0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

cmake/ScoreConfiguration.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ set(CMAKE_ANDROID_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Android")
112112
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
113113
set(CXX_IS_CLANG True)
114114

115+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fbracket-depth=1024")
116+
115117
if(("${CMAKE_CXX_COMPILER_VERSION}" VERSION_GREATER_EQUAL "16") AND ("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "20") AND LLVM_LIBCXX)
116118
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexperimental-library")
117119
elseif(APPLE)

0 commit comments

Comments
 (0)