[PATCH] D18649: [clang-tidy] cppcoreguidelines-interfaces-global-init

Clement Courbet via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 4 04:04:24 PDT 2016


courbet added inline comments.

================
Comment at: docs/clang-tidy/checks/cppcoreguidelines-interfaces-global-init.rst:7
@@ +6,3 @@
+This check flags initializers of globals that access extern objects,
+and therefore can lead to order-of-initialization problems.
+
----------------
alexfh wrote:
> What about indirect access of other globals, e.g. via function calls? We obviously can't analyze functions defined in a different translation unit, and I'm not sure we need to analyze even those defined in the same TU (since it may be imprecise and quite expensive), but maybe we should use some heuristic here (the most agressive would be to flag all initializers containing function calls, but that might be rather noisy).
The guidelines actually recommend flagging calls non-constexpr functions, but this would give too many positives. I've added a note.


http://reviews.llvm.org/D18649





More information about the cfe-commits mailing list