Skip to content

Commit

Permalink
Enable more strict standards conformance in MSVC for rvalue casting a…
Browse files Browse the repository at this point in the history
…nd string literal type conversion to non-const types. Also enables generation of intrinsics for more functions.

Patch by Alexander Riccio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256836 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
AaronBallman committed Jan 5, 2016
1 parent eaca36f commit 2498e94
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cmake/modules/HandleLLVMOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,17 @@ if( MSVC )

append("/Zc:inline" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

# Disable string literal const->non-const type conversion
# "When specified, the compiler requires strict const-qualification
# conformance for pointers initialized by using string literals."
append("/Zc:strictStrings" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

# Generate Intrinsic Functions
append("/Oi" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)

# Enforce type conversion rules
append("/Zc:rvalueCast" CMAKE_CXX_FLAGS)

# Disable sized deallocation if the flag is supported. MSVC fails to compile
# the operator new overload in User otherwise.
check_c_compiler_flag("/WX /Zc:sizedDealloc-" SUPPORTS_SIZED_DEALLOC)
Expand Down

0 comments on commit 2498e94

Please sign in to comment.