[clang] [NFC] clang add DiagnosticsTestHelper decl (PR #112820)

via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 17 20:25:03 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Jinsong Ji (jsji)

<details>
<summary>Changes</summary>

This is one of the many PRs to fix errors with LLVM_ENABLE_WERROR=on. Built by GCC 11.

Fix warning

llvm-project/clang/unittests/Basic/DiagnosticTest.cpp:19:6: error: ‘void clang::DiagnosticsTestHelper(clang::DiagnosticsEngine&)’ has not been declared within ‘clang’ [-Werror]
   19 | void clang::DiagnosticsTestHelper(DiagnosticsEngine &diag) {
      |      ^~~~~
In file included from /iusers/jinsongj/llvm-project/clang/unittests/Basic/DiagnosticTest.cpp:9:
/iusers/jinsongj/llvm-project/clang/include/clang/Basic/Diagnostic.h:567:15: note: only here as a ‘friend’
  567 |   friend void DiagnosticsTestHelper(DiagnosticsEngine &);


---
Full diff: https://github.com/llvm/llvm-project/pull/112820.diff


1 Files Affected:

- (modified) clang/include/clang/Basic/Diagnostic.h (+2) 


``````````diff
diff --git a/clang/include/clang/Basic/Diagnostic.h b/clang/include/clang/Basic/Diagnostic.h
index 3b1efdb12824c7..3f6e85634c3cf5 100644
--- a/clang/include/clang/Basic/Diagnostic.h
+++ b/clang/include/clang/Basic/Diagnostic.h
@@ -1024,6 +1024,8 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> {
   /// @}
 };
 
+void DiagnosticsTestHelper(DiagnosticsEngine &);
+
 /// RAII class that determines when any errors have occurred
 /// between the time the instance was created and the time it was
 /// queried.

``````````

</details>


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


More information about the cfe-commits mailing list