[clang] Changed Checks from TriviallyCopyable to TriviallyCopyConstructible (PR #76680)
via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 4 06:43:03 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 90c397fc56b7a04dd53cdad8103de1ead9686104 c346904caff1bf97605d84bdd0120cefe1ca35f4 -- clang/include/clang/AST/DeclCXX.h clang/include/clang/AST/Type.h clang/lib/AST/DeclCXX.cpp clang/lib/AST/Type.cpp clang/lib/Sema/SemaStmt.cpp clang/test/SemaCXX/warn-range-loop-analysis-trivially-copyable.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/include/clang/AST/Type.h b/clang/include/clang/AST/Type.h
index 4532cfe63e..e4a3f7671e 100644
--- a/clang/include/clang/AST/Type.h
+++ b/clang/include/clang/AST/Type.h
@@ -766,7 +766,9 @@ public:
bool UseExcessPrecision(const ASTContext &Ctx);
- static bool isTriviallyCopyableTypeImpl(const QualType &type, const ASTContext &Context,bool copy_constructible);
+ static bool isTriviallyCopyableTypeImpl(const QualType &type,
+ const ASTContext &Context,
+ bool copy_constructible);
/// Retrieves a pointer to the underlying (unqualified) type.
///
@@ -913,7 +915,6 @@ public:
/// CXXRecordDecl::isCXX11StandardLayout, this takes DRs into account.
bool isCXX11PODType(const ASTContext &Context) const;
-
/// Return true if this is a trivial type per (C++0x [basic.types]p9)
bool isTrivialType(const ASTContext &Context) const;
diff --git a/clang/lib/AST/Type.cpp b/clang/lib/AST/Type.cpp
index 964df0bd1c..61661f73e1 100644
--- a/clang/lib/AST/Type.cpp
+++ b/clang/lib/AST/Type.cpp
@@ -2605,16 +2605,20 @@ bool QualType::isTrivialType(const ASTContext &Context) const {
}
bool QualType::isTriviallyCopyableType(const ASTContext &Context) const {
- return isTriviallyCopyableTypeImpl(*this,Context,false);
+ return isTriviallyCopyableTypeImpl(*this, Context, false);
}
-bool QualType::isTriviallyCopyConstructibleType(const ASTContext &Context) const {
- return isTriviallyCopyableTypeImpl(*this,Context,true);
+bool QualType::isTriviallyCopyConstructibleType(
+ const ASTContext &Context) const {
+ return isTriviallyCopyableTypeImpl(*this, Context, true);
}
-bool QualType::isTriviallyCopyableTypeImpl(const QualType &type, const ASTContext &Context,bool copy_constructible){
+bool QualType::isTriviallyCopyableTypeImpl(const QualType &type,
+ const ASTContext &Context,
+ bool copy_constructible) {
if (type->isArrayType())
- return Context.getBaseElementType(type).isTriviallyCopyableTypeImpl(type,Context,copy_constructible);
+ return Context.getBaseElementType(type).isTriviallyCopyableTypeImpl(
+ type, Context, copy_constructible);
if (type.hasNonTrivialObjCLifetime())
return false;
``````````
</details>
https://github.com/llvm/llvm-project/pull/76680
More information about the cfe-commits
mailing list