- This file was added.
|1||.. title:: clang-tidy - cppcoreguidelines-interfaces-global-init|
|6||This check flags initializers of globals that access extern objects,|
|7||and therefore can lead to order-of-initialization problems.|
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).
alexfh: What about indirect access of other globals, e.g. via function calls? We obviously can't…
The guidelines actually recommend flagging calls non-constexpr functions, but this would give too many positives. I've added a note.
courbet: The guidelines actually recommend flagging calls non-constexpr functions, but this would give…
|9||This rule is part of the "Interfaces" profile of the C++ Core Guidelines, see|