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 h,cpp -- 
clang/test/SemaCXX/warn-unsafe-buffer-usage-string-view.cpp 
clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h 
clang/lib/Analysis/UnsafeBufferUsage.cpp 
clang/lib/Sema/AnalysisBasedWarnings.cpp --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/Analysis/UnsafeBufferUsage.cpp 
b/clang/lib/Analysis/UnsafeBufferUsage.cpp
index f3b06920b..ba8c3d0b7 100644
--- a/clang/lib/Analysis/UnsafeBufferUsage.cpp
+++ b/clang/lib/Analysis/UnsafeBufferUsage.cpp
@@ -1813,7 +1813,8 @@ class StringViewTwoParamConstructorGadget : public 
WarningGadget {
 public:
   StringViewTwoParamConstructorGadget(const MatchResult &Result)
       : WarningGadget(Kind::StringViewTwoParamConstructor),
-        
Ctor(Result.getNodeAs<CXXConstructExpr>(StringViewTwoParamConstructorTag)) {}
+        Ctor(Result.getNodeAs<CXXConstructExpr>(
+            StringViewTwoParamConstructorTag)) {}
 
   static bool classof(const Gadget *G) {
     return G->getKind() == Kind::StringViewTwoParamConstructor;
@@ -1856,8 +1857,8 @@ public:
   SourceLocation getSourceLoc() const override { return Ctor->getBeginLoc(); }
 
   DeclUseList getClaimedVarUseSites() const override {
-    // If the constructor call is of the form `std::string_view{var, n}`, 
`var` is
-    // considered an unsafe variable.
+    // If the constructor call is of the form `std::string_view{var, n}`, `var`
+    // is considered an unsafe variable.
     if (auto *DRE = dyn_cast<DeclRefExpr>(Ctor->getArg(0))) {
       if (isa<VarDecl>(DRE->getDecl()))
         return {DRE};
diff --git a/clang/lib/Sema/AnalysisBasedWarnings.cpp 
b/clang/lib/Sema/AnalysisBasedWarnings.cpp
index 10b077172..4dfb709e0 100644
--- a/clang/lib/Sema/AnalysisBasedWarnings.cpp
+++ b/clang/lib/Sema/AnalysisBasedWarnings.cpp
@@ -2568,9 +2568,9 @@ public:
     }
   }
 
-   void handleUnsafeOperationInStringView(const Stmt *Operation,
-                                        bool IsRelatedToDecl,
-                                        ASTContext &Ctx) override {
+  void handleUnsafeOperationInStringView(const Stmt *Operation,
+                                         bool IsRelatedToDecl,
+                                         ASTContext &Ctx) override {
     SourceLocation Loc;
     SourceRange Range;
     unsigned MsgParam = 0;

``````````

</details>


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

Reply via email to