From b841ce1df58b0a5a274d4163dcf2e9a31d082e49 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Tue, 16 Feb 2021 20:07:55 +0000 Subject: [PATCH] CMakeLists: Increase maximum bracket depth for Clang See also: https://reviews.llvm.org/D86936 Bracket depth limits size of fold expression which in turn limits size of std::array initialization via CTAD --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e1458ce..cf67fb7f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,6 +97,12 @@ else() list(APPEND DYNARMIC_CXX_FLAGS -Wfatal-errors) endif() + + if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc]lang") + # Bracket depth determines maximum size of a fold expression in Clang since 9c9974c3ccb6. + # And this in turns limits the size of a std::array. + list(APPEND DYNARMIC_CXX_FLAGS -fbracket-depth=1024) + endif() endif() # Arch detection