Details
- Reviewers
alexfh sbenza - Commits
- rG9435f5416765: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted…
rCTE269581: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted…
rL269581: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted…
Diff Detail
Event Timeline
clang-tidy/utils/TypeTraits.cpp | ||
---|---|---|
20 | I would prefer this be used locally instead of at namespace scope to avoid potential name collisions. | |
33 | !Record instead of explicit comparison. | |
35 | Why use the matcher at all? You have the record decl, it can give you the copy constructor, and you can directly inspect whether that is deleted or not. | |
test/clang-tidy/performance-unnecessary-value-param.cpp | ||
27 | This is not a move-only type. Because you have a user-declared copy constructor (or destructor), the move constructor will not be implicitly declared. See [class.copy]p9 for details. |
clang-tidy/utils/TypeTraits.cpp | ||
---|---|---|
20 | Note, that file-level using namespace ast_matchers is rather common in Clang tools, so I wouldn't bother here. That said, I'm fine either way. |
clang-tidy/utils/TypeTraits.cpp | ||
---|---|---|
33 | Does this make a difference for code generation or is this just a convention here for conciseness? |
clang-tidy/utils/TypeTraits.cpp | ||
---|---|---|
22 | Now seems to be unused. |
clang-tidy/utils/TypeTraits.cpp | ||
---|---|---|
24 | Should this be lifted to 'type_traits' ? The same function exists into clang-tidy/utils/TypeTraits.cpp namespace { bool classHasTrivialCopyAndDestroy(QualType Type) { auto *Record = Type->getAsCXXRecordDecl(); return Record && Record->hasDefinition() && !Record->hasNonTrivialCopyConstructor() && !Record->hasNonTrivialDestructor(); } } // namespace Alex, any toughs? | |
31 | ditto, to be lifted or not? |
clang-tidy/utils/TypeTraits.cpp | ||
---|---|---|
44 | You're right too. |
clang-tidy/utils/TypeTraits.cpp | ||
---|---|---|
44 | Updated to const reference now that your patch is in. |
I would prefer this be used locally instead of at namespace scope to avoid potential name collisions.