|
|
Chromium Code Reviews
DescriptionEnable noexcept on Windows, use for a few move constructors.
MSVC complains if you use noexcept with no exception handling mode specified (as we do).
This code disables the warning. noexcept on move constructors allows better optimizations
in some cases.
http://en.cppreference.com/w/cpp/language/noexcept_spec
Updates a few common classes' move constructors to use this.
Review-Url: https://codereview.chromium.org/2771643002
Cr-Commit-Position: refs/heads/master@{#458956}
Committed: https://chromium.googlesource.com/chromium/src/+/76aac97386e2788241161420c5e7e0bfee16f88c
Patch Set 1 #Patch Set 2 : jni #
Total comments: 1
Patch Set 3 : No flat_map #
Messages
Total messages: 29 (14 generated)
jni
The CQ bit was checked by brettw@chromium.org to run a CQ dry run
Description was changed from ========== Enable noexcept on Windows, use for a few move constructors. MSVC complains if you use noexcept with no exception handling mode specified (as we do). This code disables the warning. noexcept on move constructors allows better optimizations in some cases. BUG= ========== to ========== Enable noexcept on Windows, use for a few move constructors. MSVC complains if you use noexcept with no exception handling mode specified (as we do). This code disables the warning. noexcept on move constructors allows better optimizations in some cases. Updates a few common classes' move constructors to use this. ==========
brettw@chromium.org changed reviewers: + brucedawson@chromium.org
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
lgtm. Maybe include a link to this: http://en.cppreference.com/w/cpp/language/noexcept_spec and maybe this quote: "For example, containers such as std::vector will move their elements if the elements' move constructor is noexcept, and copy otherwise..." I knew there was some sordid history about annotating functions as not throwing actually making things worse, but that was throw(), and even that is fixed in C++ 17. https://codereview.chromium.org/2771643002/diff/20001/base/containers/flat_map.h File base/containers/flat_map.h (right): https://codereview.chromium.org/2771643002/diff/20001/base/containers/flat_ma... base/containers/flat_map.h:207: flat_map<Key, Mapped, Compare>::flat_map(flat_map&&) noexcept = default; That reads weird, as if you are setting noexcept to the default. But, such is this crazy language we use.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: ios-device on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios-device/builds...) mac_chromium_rel_ng on master.tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_...)
No flat_map
Description was changed from ========== Enable noexcept on Windows, use for a few move constructors. MSVC complains if you use noexcept with no exception handling mode specified (as we do). This code disables the warning. noexcept on move constructors allows better optimizations in some cases. Updates a few common classes' move constructors to use this. ========== to ========== Enable noexcept on Windows, use for a few move constructors. MSVC complains if you use noexcept with no exception handling mode specified (as we do). This code disables the warning. noexcept on move constructors allows better optimizations in some cases. http://en.cppreference.com/w/cpp/language/noexcept_spec Updates a few common classes' move constructors to use this. ==========
The CQ bit was checked by brettw@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from brucedawson@chromium.org Link to the patchset: https://codereview.chromium.org/2771643002/#ps40001 (title: "No flat_map")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by brettw@chromium.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1490226752669420,
"parent_rev": "d741d25d04cbff8e7647d204a43dc4dfa76093ca", "commit_rev":
"76aac97386e2788241161420c5e7e0bfee16f88c"}
Message was sent while issue was closed.
Description was changed from ========== Enable noexcept on Windows, use for a few move constructors. MSVC complains if you use noexcept with no exception handling mode specified (as we do). This code disables the warning. noexcept on move constructors allows better optimizations in some cases. http://en.cppreference.com/w/cpp/language/noexcept_spec Updates a few common classes' move constructors to use this. ========== to ========== Enable noexcept on Windows, use for a few move constructors. MSVC complains if you use noexcept with no exception handling mode specified (as we do). This code disables the warning. noexcept on move constructors allows better optimizations in some cases. http://en.cppreference.com/w/cpp/language/noexcept_spec Updates a few common classes' move constructors to use this. Review-Url: https://codereview.chromium.org/2771643002 Cr-Commit-Position: refs/heads/master@{#458956} Committed: https://chromium.googlesource.com/chromium/src/+/76aac97386e2788241161420c5e7... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/76aac97386e2788241161420c5e7...
Message was sent while issue was closed.
scottmg@chromium.org changed reviewers: + lfg@chromium.org, scottmg@chromium.org
Message was sent while issue was closed.
Seeing this at head, could it be due to this change? [0->353/353 ~1] CXX obj/storage/browser/browser/quota_reservation_manager.obj FAILED: obj/storage/browser/browser/quota_reservation_manager.obj ninja -t msvc -e environment.x86 -- "c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\VC\bin\amd64_x86/cl.exe" /nologo /showIncludes /FC @obj/storage/browser/browser/quota_reservation_manager.obj.rsp /c ../../storage/browser/fileapi/quota/quota_reservation_manager.cc /Foobj/storage/browser/browser/quota_reservation_manager.obj /Fd"obj/storage/browser/browser_cc.pdb" c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): error C2220: warning treated as error - no 'object' file generated c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings ninja: build stopped: subcommand failed.
Message was sent while issue was closed.
On 2017/03/23 15:38:29, scottmg wrote: > Seeing this at head, could it be due to this change? > > [0->353/353 ~1] CXX obj/storage/browser/browser/quota_reservation_manager.obj > FAILED: obj/storage/browser/browser/quota_reservation_manager.obj > ninja -t msvc -e environment.x86 -- > "c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\VC\bin\amd64_x86/cl.exe" > /nologo /showIncludes /FC > @obj/storage/browser/browser/quota_reservation_manager.obj.rsp /c > ../../storage/browser/fileapi/quota/quota_reservation_manager.cc > /Foobj/storage/browser/browser/quota_reservation_manager.obj > /Fd"obj/storage/browser/browser_cc.pdb" > c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): > error C2220: warning treated as error - no 'object' file generated > c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): > warning C4577: 'noexcept' used with no exception handling mode specified; > termination on exception is not guaranteed. Specify /EHsc > c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): > note: to simplify migration, consider the > temporary use of /Wv:18 flag with the version of the compiler with which you > used to build without warnings > ninja: build stopped: subcommand failed. [[ bisecting now to confirm... my gn args aren't too odd? c:\src\cr\src>type out\debug\args.gn is_debug = true is_component_build = true enable_nacl = false is_chrome_branded = true symbol_level = 2 target_cpu = "x86" is_win_fastlink = true is_clang = false win_console_app = true win_linker_timing = true ]]
Message was sent while issue was closed.
On 2017/03/23 15:47:16, scottmg wrote: > On 2017/03/23 15:38:29, scottmg wrote: > > Seeing this at head, could it be due to this change? > > > > [0->353/353 ~1] CXX obj/storage/browser/browser/quota_reservation_manager.obj > > FAILED: obj/storage/browser/browser/quota_reservation_manager.obj > > ninja -t msvc -e environment.x86 -- > > > "c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\VC\bin\amd64_x86/cl.exe" > > /nologo /showIncludes /FC > > @obj/storage/browser/browser/quota_reservation_manager.obj.rsp /c > > ../../storage/browser/fileapi/quota/quota_reservation_manager.cc > > /Foobj/storage/browser/browser/quota_reservation_manager.obj > > /Fd"obj/storage/browser/browser_cc.pdb" > > > c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): > > error C2220: warning treated as error - no 'object' file generated > > > c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): > > warning C4577: 'noexcept' used with no exception handling mode specified; > > termination on exception is not guaranteed. Specify /EHsc > > > c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): > > note: to simplify migration, consider the > > temporary use of /Wv:18 flag with the version of the compiler with which you > > used to build without warnings > > ninja: build stopped: subcommand failed. > > [[ bisecting now to confirm... my gn args aren't too odd? > > c:\src\cr\src>type out\debug\args.gn > is_debug = true > is_component_build = true > enable_nacl = false > is_chrome_branded = true > symbol_level = 2 > target_cpu = "x86" > is_win_fastlink = true > is_clang = false > win_console_app = true > win_linker_timing = true > > ]] 76aac97386e2788241161420c5e7e0bfee16f88c is the first bad commit commit 76aac97386e2788241161420c5e7e0bfee16f88c Author: brettw <brettw@chromium.org> Date: Wed Mar 22 17:37:36 2017 -0700 Enable noexcept on Windows, use for a few move constructors. MSVC complains if you use noexcept with no exception handling mode specified (as we do). This code disables the warning. noexcept on move constructors allows better optimizations in some cases. http://en.cppreference.com/w/cpp/language/noexcept_spec Updates a few common classes' move constructors to use this. Review-Url: https://codereview.chromium.org/2771643002 Cr-Commit-Position: refs/heads/master@{#458956} I know the bots are green, but since I can't build at head I'm going to revert for now. Sorry. :(
Message was sent while issue was closed.
A revert of this CL (patchset #3 id:40001) has been created in https://codereview.chromium.org/2769703007/ by scottmg@chromium.org. The reason for reverting is: Seems to have broken Windows build with args.gn as: > is_debug = true > is_component_build = true > enable_nacl = false > is_chrome_branded = true > symbol_level = 2 > target_cpu = "x86" > is_win_fastlink = true > is_clang = false > win_console_app = true > win_linker_timing = true.
Message was sent while issue was closed.
Same as scottmg@, I can't build after this change. Reverting this fixes my build.
Message was sent while issue was closed.
Brett and I narrowed this down to a pch dependency problem (i.e. the pch isn't necessarily rebuilt when this warning flag is changed.) Here's a log for posterity: [d47446e...]c:\src\cr\src>ninja -C out\Debug obj/storage/browser/browser/quota_reservation_manager.obj ninja: Entering directory `out\Debug' [0->1/1 ~1] Regenerating ninja files [0->1/1 ~1] CXX obj/storage/browser/browser/quota_reservation_manager.obj FAILED: obj/storage/browser/browser/quota_reservation_manager.obj ninja -t msvc -e environment.x86 -- "c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\VC\bin\amd64_x86/cl.exe" /nologo /showIncludes /FC @obj/storage/browser/browser/quota_reservation_manager.obj.rsp /c ../../storage/browser/fileapi/quota/quota_reservation_manager.cc /Foobj/storage/browser/browser/quota_reservation_manager.obj /Fd"obj/storage/browser/browser_cc.pdb" c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): error C2220: warning treated as error - no 'object' file generated c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): warning C4577: 'noexcept' used with no exception handling mode specified; termination on exception is not guaranteed. Specify /EHsc c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\vc\include\utility(113): note: to simplify migration, consider the temporary use of /Wv:18 flag with the version of the compiler with which you used to build without warnings ninja: build stopped: subcommand failed. [d47446e...]c:\src\cr\src>type out\debug\args.gn is_debug = true is_component_build = true enable_nacl = false is_chrome_branded = true symbol_level = 2 target_cpu = "x86" is_win_fastlink = true is_clang = false win_console_app = true win_linker_timing = true [d47446e...]c:\src\cr\src>type out\debug\obj\storage\browser\browser\quota_reservation_manager.obj.rsp -DSTORAGE_BROWSER_IMPLEMENTATION -DV8_DEPRECATION_WARNINGS -DUSE_AURA=1 -DNO_TCMALLOC -DDISABLE_NACL -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DGOOGLE_CHROME_BUILD -DENABLE_MEDIA_ROUTER=1 -DCOMPONENT_BUILD -D__STD_C -D_CRT_RAND_S -D_CRT_SECURE_NO_DEPRECATE -D_HAS_EXCEPTIONS=0 -D_SCL_SECURE_NO_DEPRECATE -D_ATL_NO_OPENGL -D_WINDOWS -DCERT_CHAIN_PARA_HAS_EXTRA_FIELDS -DPSAPI_VERSION=1 -DWIN32 -D_SECURE_ATL -D_USING_V110_SDK71_ -DWIN32_LEAN_AND_MEAN -DNOMINMAX -D_UNICODE -DUNICODE -DNTDDI_VERSION=0x0A000000 -D_WIN32_WINNT=0x0A00 -DWINVER=0x0A00 -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWTF_USE_DYNAMIC_ANNOTATIONS=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DPROTOBUF_USE_DLLS -DBORINGSSL_SHARED_LIBRARY -DLEVELDB_PLATFORM_CHROMIUM=1 -DSQLITE_API=__declspec(dllimport) -I../.. -Igen -I../../third_party/ced/src -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/protobuf/src -Igen/protoc_out -I../../third_party/protobuf/src -I../../third_party/boringssl/src/include -I../../third_party/leveldatabase -I../../third_party/leveldatabase/src -I../../third_party/leveldatabase/src/include /wd4117 /D__DATE__= /D__TIME__= /D__TIMESTAMP__= /Gy /FS /bigobj /d2FastFail /Zc:sizedDealloc- /W4 /WX /utf-8 /wd4091 /wd4127 /wd4251 /wd4312 /wd4351 /wd4355 /wd4503 /wd4589 /wd4611 /wd4100 /wd4121 /wd4244 /wd4505 /wd4510 /wd4512 /wd4610 /wd4838 /wd4995 /wd4996 /wd4456 /wd4457 /wd4458 /wd4459 /wd4577 /wd4267 /Od /Ob0 /GF /Zi /MDd /FIbuild/precompile.h /Fpobj/storage/browser/browser_cc.pch /Yubuild/precompile.h /TP /GR- [d47446e...]c:\src\cr\src>del out\debug\obj\storage\browser\browser_cc.pch [d47446e...]c:\src\cr\src>ninja -C out\Debug obj/storage/browser/browser/quota_reservation_manager.obj ninja: Entering directory `out\Debug' [0->1/1 ~1] CXX obj/storage/browser/browser/quota_reservation_manager.obj FAILED: obj/storage/browser/browser/quota_reservation_manager.obj ninja -t msvc -e environment.x86 -- "c:\src\depot_tools\win_toolchain\vs_files\d3cb0e37bdd120ad0ac4650b674b09e81be45616\VC\bin\amd64_x86/cl.exe" /nologo /showIncludes /FC @obj/storage/browser/browser/quota_reservation_manager.obj.rsp /c ../../storage/browser/fileapi/quota/quota_reservation_manager.cc /Foobj/storage/browser/browser/quota_reservation_manager.obj /Fd"obj/storage/browser/browser_cc.pdb" c:\src\cr\src\storage\browser\fileapi\quota\quota_reservation_manager.cc: fatal error C1083: Cannot open precompiled header file: 'obj/storage/browser/browser_cc.pch': No such file or directory ninja: build stopped: subcommand failed. [d47446e...]c:\src\cr\src>ninja -C out\Debug obj/storage/browser/browser_cc.pch ninja: Entering directory `out\Debug' ninja: error: unknown target 'obj/storage/browser/browser_cc.pch' [d47446e...]c:\src\cr\src>ninja -C out\Debug obj/storage/browser/browser/precompile.cc.obj ninja: Entering directory `out\Debug' ninja: no work to do. [d47446e...]c:\src\cr\src>del out\debug\obj\storage\browser\browser\precompile.cc.obj [d47446e...]c:\src\cr\src>ninja -C out\Debug obj/storage/browser/browser/precompile.cc.obj ninja: Entering directory `out\Debug' [0->1/1 ~1] CXX obj/storage/browser/browser/precompile.cc.obj [d47446e...]c:\src\cr\src>ninja -C out\Debug obj/storage/browser/browser/quota_reservation_manager.obj ninja: Entering directory `out\Debug' [0->1/1 ~1] CXX obj/storage/browser/browser/quota_reservation_manager.obj
Message was sent while issue was closed.
Small notes on noexcept and default. https://godbolt.org/g/Aji72L if you have compilation problems I suggest just to do, in particular for flat_* containers/trees etc. class X { X(X&&) = default; X& operator=(X&&) = default }; |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
