From 652cc82b35ff9e14097d12eff73f53348361ff15 Mon Sep 17 00:00:00 2001 From: Chuck Walbourn Date: Thu, 15 May 2025 22:25:44 -0700 Subject: [PATCH] Enable some additional C++20 and C++23 compat warnings with clang (#614) --- build/CompilerAndLinker.cmake | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build/CompilerAndLinker.cmake b/build/CompilerAndLinker.cmake index a61b58a..50f1622 100644 --- a/build/CompilerAndLinker.cmake +++ b/build/CompilerAndLinker.cmake @@ -119,6 +119,14 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|IntelLLVM") if(WINDOWS_STORE) list(APPEND COMPILER_DEFINES _SILENCE_CLANG_COROUTINE_MESSAGE) endif() + + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0) + list(APPEND COMPILER_SWITCHES -Wc++20-compat) + endif() + + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0) + list(APPEND COMPILER_SWITCHES -Wc++23-compat) + endif() elseif(CMAKE_CXX_COMPILER_ID MATCHES "Intel") list(APPEND COMPILER_SWITCHES /Zc:__cplusplus /Zc:inline /fp:fast /Qdiag-disable:161) elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")