damokelis opened a new pull request, #67459:
URL: https://github.com/apache/doris/pull/67459
### What problem does this PR solve?
Under Unity Build, `be/src/exec/sink/writer/async_result_writer.cpp` fails
to compile:
```
error: redeclaration of `clear_blocks` may not have default arguments
```
`clear_blocks<T>()` is declared twice with the same default argument for
`memory_used_counter`:
- `be/src/exec/exchange/local_exchanger.h:27-28` — the original declaration,
`= nullptr`
- `be/src/exec/sink/writer/async_result_writer.cpp:316-317` — a forward
declaration added by #66400 ([opt](build) 1/4: Speed up BE full build ~22% by
cutting hot-header include edges) to avoid pulling in `local_exchanger.h`, also
`= nullptr`
C++ forbids repeating a default argument across declarations of the same
function template ([dcl.fct.default]/4). Separate translation units never see
both, so a normal build is fine — but Unity Build concatenates sources into one
TU, both declarations land together, and `-Werror` turns it into a hard error.
### Fix
Drop the default from the forward declaration in `async_result_writer.cpp`.
The one in `local_exchanger.h` still applies at every call site that sees that
header, so no call site changes.
### Release note
None
### Check List
- [x] Test <!-- At least one of them must be included. -->
- [x] No need to test or manual test. Explain why:
- Compile-only fix; no behavior change. The removed token is a
default argument on a *declaration*, and every existing call site passes the
argument explicitly or sees the header-declared default.
- [x] Behavior changed:
- [x] No.
- [x] Does this need documentation?
- [x] No.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]