Enable -Wglobal-constructors warning for non-test targets |
|||
Issue descriptionIf we can enable -Wglobal-constructors on non-test targets (test isn't possible because of the way gtest works; nor desirable IMO as it might be too restrictive for tricky tests), then we can drop LazyInstance in favor of constexpr default initialization in a bunch of places and be confident we don't incur static initializers :) Ultimately helps mitigate priority inversion in initialization of globals (issue 800760).
,
Jan 19 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/c78d4f5766ee9d828176da85673319cf1235f9e6 commit c78d4f5766ee9d828176da85673319cf1235f9e6 Author: Gabriel Charette <gab@chromium.org> Date: Fri Jan 19 12:11:22 2018 Add -Wexit-time-destructors to //base This was not obvious to me but -Wglobal-constructors implies -Wexit-time-destructors (because an exit time destructor implies a registration at initialization time), full discussion @ http://clang-developers.42468.n3.nabble.com/Wglobal-constructors-warns-on-constexpr-default-constructor-evaluated-at-compile-time-td4059304.html Adding the flag to be explicit about it. R=dcheng@chromium.org Bug: 801563 Change-Id: I0f57a4073eb8afcb2bac65ba7a8826f1b8d14cb4 Reviewed-on: https://chromium-review.googlesource.com/870551 Reviewed-by: Daniel Cheng <dcheng@chromium.org> Commit-Queue: Gabriel Charette <gab@chromium.org> Cr-Commit-Position: refs/heads/master@{#530490} [modify] https://crrev.com/c78d4f5766ee9d828176da85673319cf1235f9e6/base/BUILD.gn
,
Jan 22 2018
I'm still strongly interested in this but will yield this task for now, at least made it in //base.
,
May 3 2018
,
Sep 17
|
|||
►
Sign in to add a comment |
|||
Comment 1 by bugdroid1@chromium.org
, Jan 19 2018