From 8a64f7e78483fcdf35562dcf288007e75361ffd1 Mon Sep 17 00:00:00 2001 From: moke-HU <25567926679@qq.com> Date: Fri, 28 Aug 2026 08:33:09 +0800 Subject: [PATCH] [fix](be) remove duplicate default argument on clear_blocks forward declaration Upstream commit 6922ab5bb42 ([opt](build) 1/4: Speed up BE full build ~22% by cutting hot-header include edges (#66400)) added a forward declaration of clear_blocks() in async_result_writer.cpp to avoid pulling in exec/exchange/local_exchanger.h, which already declares the same template with a default argument for memory_used_counter. C++ forbids a default argument from being repeated across declarations of the same function/template, so under Unity Build both declarations land in the same translation unit and -Werror turns this into a hard "redeclaration ... may not have default arguments" error. Drop the default from this file's forward declaration; the one in local_exchanger.h still applies at call sites that see both headers. --- be/src/exec/sink/writer/async_result_writer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/be/src/exec/sink/writer/async_result_writer.cpp b/be/src/exec/sink/writer/async_result_writer.cpp index 46c6cdf159cbf9..6397dc660e0544 100644 --- a/be/src/exec/sink/writer/async_result_writer.cpp +++ b/be/src/exec/sink/writer/async_result_writer.cpp @@ -315,7 +315,7 @@ std::unique_ptr AsyncResultWriter::_get_free_block(doris::Block* block, s template void clear_blocks(moodycamel::ConcurrentQueue& blocks, - RuntimeProfile::Counter* memory_used_counter = nullptr); + RuntimeProfile::Counter* memory_used_counter); void AsyncResultWriter::set_low_memory_mode() { _low_memory_mode = true; clear_blocks(_free_blocks, _memory_used_counter);