[PATCH] D117593: [clang-tidy] Change google-explicit-constructor to ignore conversions and operators marked `explicit(false)`
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 26 12:30:06 PST 2022
aaron.ballman added a comment.
Hmmm, this is a rule for checking a specific style guide. https://google.github.io/styleguide/cppguide.html#Implicit_Conversions doesn't say that `explicit(false)` is a reasonable marking. In fact, it says "Implicit conversions can sometimes be necessary and appropriate for types that are designed to be interchangeable, for example when objects of two types are just different representations of the same underlying value. In that case, contact your project leads to request a waiver of this rule."
So I think this behavior needs to be behind a flag so that the default behavior continues to match what the style guide requires (or the style guide should be updated to clarify the behavior of `explicit(false)`).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117593/new/
https://reviews.llvm.org/D117593
More information about the cfe-commits
mailing list