1 .. title:: clang-tidy - fuchsia-statically-constructed-objects
3 fuchsia-statically-constructed-objects
4 ======================================
6 Warns if global, non-trivial objects with static storage are constructed, unless
7 the object is statically initialized with a ``constexpr`` constructor or has no
18 B(int Val) : Val(Val) {}
25 constexpr C(int Val) : Val(Val) {}
26 C(int Val1, int Val2) : Val(Val1+Val2) {}
32 static A a; // No warning, as there is no explicit constructor
33 static C c(0); // No warning, as constructor is constexpr
35 static B b(0); // Warning, as constructor is not constexpr
36 static C c2(0, 1); // Warning, as constructor is not constexpr
38 static int i; // No warning, as it is trivial
41 static C c3(get_i());// Warning, as the constructor is dynamically initialized
43 See the features disallowed in Fuchsia at https://fuchsia.dev/fuchsia-src/development/languages/c-cpp/cxx?hl=en