[PATCH] D53882: [clang-tidy] Adding Zircon checker for std namespace

Julie Hockett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 2 12:53:18 PDT 2018


juliehockett planned changes to this revision.
juliehockett marked 5 inline comments as done.
juliehockett added a comment.

In https://reviews.llvm.org/D53882#1282219, @aaron.ballman wrote:

> I am a bit confused by what this check is trying to accomplish. It seems like this is intended to catch use of anything declared within the standard library, but that includes library support things that are needed to write useful code. For instance, it seems this means users cannot use initializer lists or type traits. I'm not even certain users can overload `operator new()` because that uses `std::size_t` as an argument.
>
> Can you expound on the requirements in a bit more detail? Is it truly "no standard library functionality at all, including things required to be supported in freestanding implementations"?


Yes. We're in the process of enabling the C++ standard library in the Zircon userspace code, and there is a firm requirement that no kernel code use anything in the std namespace (which declares its own implementations of things like type traits).

That said, the policy rollout has shifted a bit since I implemented this and so I'll be reworking it a bit (and also likely renaming it to zircon-kernel-no-std-namespace, so we can disable it for userspace code). Thanks all for your comments!


https://reviews.llvm.org/D53882





More information about the cfe-commits mailing list