[clang] [BoundsSafety][Sema] Allow counted_by and counted_by_or_null on pointers where the pointee type is incomplete but potentially completable (PR #106321)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 24 08:06:58 PDT 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 d269ec321dfdfcd817544da0a94dc42c109694a2 683591114cedc210e3c2f9773330e9e42d38a610 --extensions h,c,cpp -- clang/test/Sema/attr-counted-by-struct-ptrs-completable-incomplete-pointee.c clang/unittests/Sema/GetCountedByAttrSourceRange.cpp clang/include/clang/AST/Type.h clang/include/clang/Sema/Sema.h clang/lib/AST/Type.cpp clang/lib/Sema/SemaBoundsSafety.cpp clang/lib/Sema/SemaExpr.cpp clang/lib/Sema/SemaInit.cpp clang/test/Sema/attr-counted-by-late-parsed-struct-ptrs.c clang/test/Sema/attr-counted-by-or-null-last-field.c clang/test/Sema/attr-counted-by-or-null-late-parsed-struct-ptrs.c clang/test/Sema/attr-counted-by-or-null-struct-ptrs.c clang/test/Sema/attr-counted-by-struct-ptrs.c clang/test/Sema/attr-counted-by-vla.c
``````````

</details>

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

``````````diff
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index 01429dcdaf..3ea1a6a633 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -8214,8 +8214,7 @@ ExprResult InitializationSequence::Perform(Sema &S,
         // first error.
         S.BoundsSafetyCheckInitialization(Entity, Kind,
                                           AssignmentAction::Initializing,
-                                          Step->Type,
-                                          CurInit.get());
+                                          Step->Type, CurInit.get());
       }
       break;
     }

``````````

</details>


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


More information about the cfe-commits mailing list