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 cpp,h -- 
lldb/test/API/lang/cpp/template-diagnostic-hint/main.cpp 
lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp 
lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h 
--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/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp 
b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
index fbd622d3d..24a64eb87 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.cpp
@@ -989,23 +989,24 @@ void ClangUserExpression::FixupCVRParseErrorDiagnostics(
       !m_fixed_text.empty() ? m_fixed_text.c_str() : m_expr_text.c_str());
 }
 
-void ClangUserExpression::FixupTemplateLookupDiagnostics(DiagnosticManager 
&diagnostic_manager) const {
-  if (llvm::none_of(
-      diagnostic_manager.Diagnostics(),
-      [](std::unique_ptr<Diagnostic> const &diag) {
-        switch (diag->GetCompilerID()) {
-        case clang::diag::err_non_template_in_template_id:
-        case clang::diag::err_no_template:
-        case clang::diag::err_no_member_template:
-          return true;
-        default:
-          return false;
-        }
-      }))
+void ClangUserExpression::FixupTemplateLookupDiagnostics(
+    DiagnosticManager &diagnostic_manager) const {
+  if (llvm::none_of(diagnostic_manager.Diagnostics(),
+                    [](std::unique_ptr<Diagnostic> const &diag) {
+                      switch (diag->GetCompilerID()) {
+                      case clang::diag::err_non_template_in_template_id:
+                      case clang::diag::err_no_template:
+                      case clang::diag::err_no_member_template:
+                        return true;
+                      default:
+                        return false;
+                      }
+                    }))
     return;
 
   diagnostic_manager.AddDiagnostic(
-      "Naming template instantiation not yet supported. If calling a template 
function, "
+      "Naming template instantiation not yet supported. If calling a template "
+      "function, "
       "try doing so using its mangled name. E.g., expression _Z3fooIiEvi(5)",
       lldb::eSeverityInfo, eDiagnosticOriginLLDB);
 }
diff --git a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h 
b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
index 979d3bd8a..74aceed1d 100644
--- a/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
+++ b/lldb/source/Plugins/ExpressionParser/Clang/ClangUserExpression.h
@@ -215,7 +215,8 @@ private:
   void
   FixupCVRParseErrorDiagnostics(DiagnosticManager &diagnostic_manager) const;
 
-  void FixupTemplateLookupDiagnostics(DiagnosticManager &diagnostic_manager) 
const;
+  void
+  FixupTemplateLookupDiagnostics(DiagnosticManager &diagnostic_manager) const;
 
   /// Defines how the current expression should be wrapped.
   ClangExpressionSourceCode::WrapKind GetWrapKind() const;
diff --git a/lldb/test/API/lang/cpp/template-diagnostic-hint/main.cpp 
b/lldb/test/API/lang/cpp/template-diagnostic-hint/main.cpp
index 00e4a25d1..914d9b594 100644
--- a/lldb/test/API/lang/cpp/template-diagnostic-hint/main.cpp
+++ b/lldb/test/API/lang/cpp/template-diagnostic-hint/main.cpp
@@ -3,13 +3,12 @@ template <typename T, typename K> static K 
some_template_func(int x) {
 }
 
 template <typename T> struct Foo {
-  template<typename K>
-  T method(K k) { return (T)k; }
+  template <typename K> T method(K k) { return (T)k; }
   static T smethod() { return (T)10; }
 };
 
 int main() {
   Foo<int> f;
-  return some_template_func<int, long>(5) +
-         Foo<int>::smethod() + f.method<long>(10);
+  return some_template_func<int, long>(5) + Foo<int>::smethod() +
+         f.method<long>(10);
 }

``````````

</details>


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

Reply via email to