solenv/gbuild/platform/com_MSC_defs.mk |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 064937d0b5f6786e3ec347fdc5b2c771de348ffa
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Wed Oct 2 15:37:40 2024 +0200
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Wed Oct 2 17:35:18 2024 +0200

    Avoid C4847 with --with-latest-c++ when compiling CLR
    
    > [build CLR] cli_ure/source/climaker/climaker_emit.cxx
    > c1xx: error C2220: the following warning is treated as an error
    > c1xx: warning C4857: C++/CLI mode does not support C++ versions newer 
than C++20; setting language to /std:c++20
    
    etc., as seen now with at least VS2022 Preview 17.12.0 Preview 2.1
    
    Change-Id: I34d5bca2a81e849ba24b8df5f41ebb12f08a75fd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174389
    Reviewed-by: Stephan Bergmann <stephan.bergm...@allotropia.de>
    Tested-by: Jenkins

diff --git a/solenv/gbuild/platform/com_MSC_defs.mk 
b/solenv/gbuild/platform/com_MSC_defs.mk
index 36ce2b1f964b..e915036b54c8 100644
--- a/solenv/gbuild/platform/com_MSC_defs.mk
+++ b/solenv/gbuild/platform/com_MSC_defs.mk
@@ -263,10 +263,16 @@ gb_LTOFLAGS := $(if $(filter TRUE,$(ENABLE_LTO)),-GL)
 # be suppressed by -wd4857, only by -Wv:18. The warning seems incorrect, 
because
 # using -std:c++17 produces errors about undeclared 'char8_t'. VS2022 doesn't
 # have the problem, so drop -Wv:18 when bumping baseline.
+# Similarly, at least VS2022 Preview 17.12.0 Preview 2.1 with 
--with-latest-c++ emits a "warning
+# C4857: C++/CLI mode does not support C++ versions newer than C++20; setting 
language to
+# /std:c++20" that cannot be disabled by adding -wd4857, so hardcode a 
-std:c++20 substitution in
+# that case:
 gb_CXXCLRFLAGS := \
        $(if $(COM_IS_CLANG), \
            $(patsubst -std=%,-std:c++20 -Zc:__cplusplus,$(gb_CXXFLAGS)), \
-           $(gb_CXXFLAGS)) \
+           $(if $(filter -std:c++latest,$(CXXFLAGS_CXX11)), \
+               $(patsubst -std:c++latest,-std:c++20,$(gb_CXXFLAGS)), \
+               $(gb_CXXFLAGS))) \
        $(gb_LinkTarget_EXCEPTIONFLAGS) \
        -AI $(INSTDIR)/$(LIBO_URE_LIB_FOLDER) \
        -EHa \
@@ -274,6 +280,7 @@ gb_CXXCLRFLAGS := \
        $(if $(filter 16.0,$(VCVER)),-Wv:18) \
        -Zc:twoPhase- \
 
+
 ifeq ($(COM_IS_CLANG),TRUE)
 
 gb_CFLAGS += \

Reply via email to