diff options
author | Adam Midvidy <amidvidy@gmail.com> | 2015-08-24 19:02:08 -0400 |
---|---|---|
committer | Adam Midvidy <amidvidy@gmail.com> | 2015-08-24 19:02:13 -0400 |
commit | 3e21b91dcc4d95a06e3f3a80142a686d92896cac (patch) | |
tree | abbbcc98696a6a945e95fc266fb210b3a20cce90 /SConstruct | |
parent | f480380df5107c2204ebbd250282dec18cc2a20d (diff) | |
download | mongo-3e21b91dcc4d95a06e3f3a80142a686d92896cac.tar.gz |
SERVER-18668 warn about pessimizing/redundant moves if compiler can do so
Diffstat (limited to 'SConstruct')
-rw-r--r-- | SConstruct | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct index 171bdf27212..8ef78d3780c 100644 --- a/SConstruct +++ b/SConstruct @@ -1683,6 +1683,13 @@ def doConfigure(myenv): # Don't issue warnings about potentially evaluated expressions AddToCCFLAGSIfSupported(myenv, "-Wno-potentially-evaluated-expression") + # Warn about moves of prvalues, which can inhibit copy elision. + AddToCXXFLAGSIfSupported(myenv, "-Wpessimizing-move") + + # Warn about redundant moves, such as moving a local variable in a return that is different + # than the return type. + AddToCXXFLAGSIfSupported(myenv, "-Wredundant-move") + # Check if we need to disable null-conversion warnings if myenv.ToolchainIs('clang'): def CheckNullConversion(context): |