Skip to content

Commit 6a623e8

Browse files
authored
[NFC] add DiagnosticsTestHelper decl (#112820)
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 llvm-project/clang/unittests/Basic/DiagnosticTest.cpp:9: llvm-project/clang/include/clang/Basic/Diagnostic.h:567:15: note: only here as a ‘friend’ 567 | friend void DiagnosticsTestHelper(DiagnosticsEngine &);
1 parent 8182f81 commit 6a623e8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/unittests/Basic/DiagnosticTest.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@
1616
using namespace llvm;
1717
using namespace clang;
1818

19+
// Declare DiagnosticsTestHelper to avoid GCC warning
20+
namespace clang {
21+
void DiagnosticsTestHelper(DiagnosticsEngine &diag);
22+
}
23+
1924
void clang::DiagnosticsTestHelper(DiagnosticsEngine &diag) {
2025
EXPECT_FALSE(diag.DiagStates.empty());
2126
EXPECT_TRUE(diag.DiagStatesByLoc.empty());

0 commit comments

Comments
 (0)