1 //===--- TypeTraits.h - clang-tidy-------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H
10 #define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H
12 #include "clang/AST/ASTContext.h"
13 #include "clang/AST/Type.h"
16 namespace clang::tidy::utils::type_traits
{
18 /// Returns `true` if `Type` is expensive to copy.
19 std::optional
<bool> isExpensiveToCopy(QualType Type
, const ASTContext
&Context
);
21 /// Returns `true` if `Type` is trivially default constructible.
22 bool isTriviallyDefaultConstructible(QualType Type
, const ASTContext
&Context
);
24 /// Returns `true` if `RecordDecl` is trivially default constructible.
25 bool recordIsTriviallyDefaultConstructible(const RecordDecl
&RecordDecl
,
26 const ASTContext
&Context
);
28 /// Returns `true` if `Type` is trivially destructible.
29 bool isTriviallyDestructible(QualType Type
);
31 /// Returns true if `Type` has a non-trivial move constructor.
32 bool hasNonTrivialMoveConstructor(QualType Type
);
34 /// Return true if `Type` has a non-trivial move assignment operator.
35 bool hasNonTrivialMoveAssignment(QualType Type
);
37 } // namespace clang::tidy::utils::type_traits
39 #endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_UTILS_TYPETRAITS_H