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
- Repository
 - rL LLVM
 
Event Timeline
| clang-tidy/utils/TypeTraits.cpp | ||
|---|---|---|
| 20 ↗ | (On Diff #56913) | I would prefer this be used locally instead of at namespace scope to avoid potential name collisions.  | 
| 32 ↗ | (On Diff #56913) | !Record instead of explicit comparison.  | 
| 34 ↗ | (On Diff #56913) | 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 ↗ | (On Diff #56913) | 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 ↗ | (On Diff #56913) | 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 | ||
|---|---|---|
| 32 ↗ | (On Diff #56913) | Does this make a difference for code generation or is this just a convention here for conciseness?  | 
| clang-tidy/utils/TypeTraits.cpp | ||
|---|---|---|
| 22 ↗ | (On Diff #57035) | Now seems to be unused.  | 
| clang-tidy/utils/TypeTraits.cpp | ||
|---|---|---|
| 24 ↗ | (On Diff #57035) | 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();
}
} // namespaceAlex, any toughs?  | 
| 31 ↗ | (On Diff #57035) | ditto, to be lifted or not?  | 
| clang-tidy/utils/TypeTraits.cpp | ||
|---|---|---|
| 42 ↗ | (On Diff #57129) | You're right too.  | 
| clang-tidy/utils/TypeTraits.cpp | ||
|---|---|---|
| 42 ↗ | (On Diff #57129) | Updated to const reference now that your patch is in.  |