Merge pull request #10550 from shuffle2/cpp-conform

msvc: enable conformant __cplusplus macro
This commit is contained in:
Admiral H. Curtiss 2022-04-02 14:57:39 +02:00 committed by GitHub
commit c028f96280
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -265,7 +265,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "MSVC")
# Fix non-conformant lambda behavior (constexpr variables shouldn't need capturing)
add_compile_options(/experimental:newLambdaProcessor)
# Fix various other non-conformant behaviors
add_compile_options(/Zc:externConstexpr,lambda,preprocessor)
add_compile_options(/Zc:__cplusplus,externConstexpr,lambda,preprocessor)
# Temporarily disable warnings to enable /Zc:preprocessor compatibility with WinSDK headers.
add_compile_options(

View File

@ -97,7 +97,7 @@
<!--Enable Standard Conformance-->
<ConformanceMode>true</ConformanceMode>
<!--Enforce some behaviors as standards-conformant when they don't default as such.-->
<AdditionalOptions>/Zc:externConstexpr,lambda,preprocessor,throwingNew /volatile:iso %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/Zc:__cplusplus,externConstexpr,lambda,preprocessor,throwingNew /volatile:iso %(AdditionalOptions)</AdditionalOptions>
<!--Enable detailed debug info-->
<AdditionalOptions>/Zo %(AdditionalOptions)</AdditionalOptions>
<!--Treat sources as utf-8-->