Adds a check to the Fuchsia module to warn if statically-stored objects are created, unless constructed with constexpr.
See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference.
Differential D41546
[clang-tidy] Adding Fuchsia checker for statically constructed objects juliehockett on Dec 22 2017, 11:36 AM. Authored by
Details
Adds a check to the Fuchsia module to warn if statically-stored objects are created, unless constructed with constexpr. See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference.
Diff Detail
Event TimelineComment Actions What happens for c++98? I realize that fuchsia is c++14 but we might still think about not having constexpr.
Comment Actions
Comment Actions Aside from a minor formatting nit that I missed, LGTM!
|
The coding standard document is not very clear about what is and is not covered by this check. For instance, it seems it would also cover static int i; (because i is an object that is statically constructed).
Do you intend to cover code that has implicit static storage duration, or only if it's explicitly declared with the static storage specifier? For instance, this check currently will flag: