[PATCH] D20170: [clang-tidy] TypeTraits - Type is not expensive to copy when it has a deleted copy constructor.
Etienne Bergeron via cfe-commits
cfe-commits at lists.llvm.org
Thu May 12 13:06:23 PDT 2016
etienneb added inline comments.
================
Comment at: clang-tidy/utils/TypeTraits.cpp:24
@@ -20,2 +23,3 @@
+
bool classHasTrivialCopyAndDestroy(QualType Type) {
auto *Record = Type->getAsCXXRecordDecl();
----------------
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?
================
Comment at: clang-tidy/utils/TypeTraits.cpp:31
@@ +30,3 @@
+
+bool hasDeletedCopyConstructor(QualType Type, ASTContext &Context) {
+ auto *Record = Type->getAsCXXRecordDecl();
----------------
aaron.ballman wrote:
> No need to pass in `Context` any longer.
ditto, to be lifted or not?
http://reviews.llvm.org/D20170
More information about the cfe-commits
mailing list