This checker warns for the modification of std namespace.
More information:
https://www.securecoding.cert.org/confluence/display/cplusplus/DCL58-CPP.+Do+not+modify+the+standard+namespaces
Differential D23421
[Clang-tidy] CERT-DCL58-CPP (checker for std namespace modification) xazax.hun on Aug 11 2016, 1:17 PM. Authored by
Details
This checker warns for the modification of std namespace. More information:
Diff Detail
Event TimelineComment Actions Please mention this check in docs/ReleaseNotes.rst (in alphabetical order).
Comment Actions Thank you for working on this check! There is a slight problem, however, in that the check as-written will flag false positives because there are times when it is permissible to modify the std namespace. The important bit of the CERT requirement is "Do not add declarations or definitions to the standard namespaces std or posix, or to a namespace contained therein, except for a template specialization that depends on a user-defined type that meets the standard library requirements for the original template." So the part that's missing from this check is excluding template specializations that depend on user-defined types. For instance, the following should be valid: namespace std { template <> struct is_error_code_enum<llvm::object::object_error> : std::true_type {}; } (This comes from Error.h in LLVM.)
Comment Actions Benedek, do you have time to address the review comments or do you want me to commandeer this revision? Comment Actions Unfortunately I wont have time to work on this check anymore... thank you for understanding! Comment Actions
Comment Actions
Comment Actions
|