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 origin/main HEAD --extensions c,cpp,h -- 
clang/include/clang/Sema/Sema.h clang/lib/Sema/SemaBoundsSafety.cpp 
clang/lib/Sema/SemaType.cpp clang/test/AST/attr-counted-by-function-params.c 
clang/test/Sema/attr-counted-by-function-params.c --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

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

``````````diff
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 10eac661a..e041da9b9 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -9509,37 +9509,39 @@ static void processTypeAttrs(TypeProcessingState 
&state, QualType &type,
       break;
     }
 
-    COUNTED_BY_TYPE_ATTRS_CASELIST: {
-      DeclaratorContext Ctx = state.getDeclarator().getContext();
-      bool OnParam = Ctx == DeclaratorContext::Prototype ||
-                     Ctx == DeclaratorContext::ObjCParameter ||
-                     Ctx == DeclaratorContext::KNRTypeList;
-      // FIXME: Only the GNU spelling is late-parsed, and the late-parsing path
-      // hasn't been switched to the new mechanism to support type-position
-      // attributes yet. Leave a late-parsed one to declaration attribute
-      // processing. A parameter's is parsed where it is written.
-      if (state.getSema().getLangOpts().ExperimentalLateParseAttributes &&
-          attr.isGNUAttribute() && !OnParam)
-        break;
-      // The attribute only applies to fields and parameters for now. Leave it
-      // to declaration attribute processing, which diagnoses the GNU spelling.
-      // That doesn't see a [[]] one on a declarator chunk, so diagnose it here
-      // as the default case would.
-      if (Ctx != DeclaratorContext::Member && !OnParam) {
-        if (!attr.isGNUAttribute() && TAL == TAL_DeclChunk) {
-          state.getSema().Diag(attr.getLoc(), 
diag::err_attribute_not_type_attr)
-              << attr << attr.isRegularKeywordAttribute();
-          attr.setUsedAsTypeAttr();
+    COUNTED_BY_TYPE_ATTRS_CASELIST:
+      {
+        DeclaratorContext Ctx = state.getDeclarator().getContext();
+        bool OnParam = Ctx == DeclaratorContext::Prototype ||
+                       Ctx == DeclaratorContext::ObjCParameter ||
+                       Ctx == DeclaratorContext::KNRTypeList;
+        // FIXME: Only the GNU spelling is late-parsed, and the late-parsing
+        // path hasn't been switched to the new mechanism to support
+        // type-position attributes yet. Leave a late-parsed one to declaration
+        // attribute processing. A parameter's is parsed where it is written.
+        if (state.getSema().getLangOpts().ExperimentalLateParseAttributes &&
+            attr.isGNUAttribute() && !OnParam)
+          break;
+        // The attribute only applies to fields and parameters for now. Leave 
it
+        // to declaration attribute processing, which diagnoses the GNU
+        // spelling. That doesn't see a [[]] one on a declarator chunk, so
+        // diagnose it here as the default case would.
+        if (Ctx != DeclaratorContext::Member && !OnParam) {
+          if (!attr.isGNUAttribute() && TAL == TAL_DeclChunk) {
+            state.getSema().Diag(attr.getLoc(),
+                                 diag::err_attribute_not_type_attr)
+                << attr << attr.isRegularKeywordAttribute();
+            attr.setUsedAsTypeAttr();
+          }
+          break;
         }
+        if (TAL == TAL_DeclSpec && attr.isGNUAttribute() &&
+            distributeBoundsAttrFromDeclSpec(state, attr))
+          break;
+        HandleCountedByAttrOnType(state, type, attr);
+        attr.setUsedAsTypeAttr();
         break;
       }
-      if (TAL == TAL_DeclSpec && attr.isGNUAttribute() &&
-          distributeBoundsAttrFromDeclSpec(state, attr))
-        break;
-      HandleCountedByAttrOnType(state, type, attr);
-      attr.setUsedAsTypeAttr();
-      break;
-    }
 
     MS_TYPE_ATTRS_CASELIST:
       if (!handleMSPointerTypeQualifierAttr(state, attr, type))

``````````

</details>


https://github.com/llvm/llvm-project/pull/244630
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to