[clang] [CUDA][HIP] Fix host/device context in concept (PR #67721)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 28 11:43:50 PDT 2023


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 720e3bacbd9fdba05645a4d621d43ad712c44df3 93c1086002a4a946ac2fc9066539733db750204f -- clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaCUDA.cpp clang/lib/Sema/SemaConcept.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/Sema/SemaCUDA.cpp b/clang/lib/Sema/SemaCUDA.cpp
index e72c42e67..285711116 100644
--- a/clang/lib/Sema/SemaCUDA.cpp
+++ b/clang/lib/Sema/SemaCUDA.cpp
@@ -114,8 +114,7 @@ static bool hasAttr(const Decl *D, bool IgnoreImplicitAttr) {
 
 Sema::CUDATargetContextRAII::CUDATargetContextRAII(Sema &S_,
                                                    CUDATargetContextKind K,
-                                                   const Decl *D,
-                                                   const Expr *E)
+                                                   const Decl *D, const Expr *E)
     : S(S_) {
   SavedCtx = S.CurCUDATargetCtx;
   auto Target = CFT_Host;
@@ -135,7 +134,7 @@ Sema::CUDATargetContextRAII::CUDATargetContextRAII(Sema &S_,
   S.CurCUDATargetCtx = {Target, K, D, E};
 }
 
-bool Sema::CUDATargetContext::shouldOverride(const Decl *D)const {
+bool Sema::CUDATargetContext::shouldOverride(const Decl *D) const {
   return Kind == CTCK_Constraint || D == nullptr;
 }
 
diff --git a/clang/lib/Sema/SemaConcept.cpp b/clang/lib/Sema/SemaConcept.cpp
index 6475f4e3d..94e2b4e44 100644
--- a/clang/lib/Sema/SemaConcept.cpp
+++ b/clang/lib/Sema/SemaConcept.cpp
@@ -337,7 +337,7 @@ static ExprResult calculateConstraintSatisfaction(
     const MultiLevelTemplateArgumentList &MLTAL, const Expr *ConstraintExpr,
     ConstraintSatisfaction &Satisfaction) {
   Sema::CUDATargetContextRAII X(S, Sema::CTCK_Constraint,
-      /*Decl=*/nullptr, ConstraintExpr);
+                                /*Decl=*/nullptr, ConstraintExpr);
   return calculateConstraintSatisfaction(
       S, ConstraintExpr, Satisfaction, [&](const Expr *AtomicExpr) {
         EnterExpressionEvaluationContext ConstantEvaluated(

``````````

</details>


https://github.com/llvm/llvm-project/pull/67721


More information about the cfe-commits mailing list