Fix ambiguous namespace resolution for Sample in bvar::detail#525
Open
day253 wants to merge 1 commit intobaidu:masterfrom
Open
Fix ambiguous namespace resolution for Sample in bvar::detail#525day253 wants to merge 1 commit intobaidu:masterfrom
day253 wants to merge 1 commit intobaidu:masterfrom
Conversation
Inside `namespace bvar::detail`, the qualified name `detail::Sample<Stat>` resolves to `bvar::detail::detail::Sample<Stat>`, which does not exist. Since the code is already within `namespace bvar::detail`, use the unqualified `Sample<Stat>` which correctly resolves to `bvar::detail::Sample<Stat>`. This fixes compilation errors when building braft against brpc >= 1.16.0, where changes to bvar's internal namespace structure exposed this pre-existing ambiguity. Made-with: Cursor
Author
|
Hi, this PR fixes the compilation error reported in #524 (braft 1.1.2 incompatibility with brpc 1.16.0). The fix has been verified across 15 platforms via vcpkg CI: microsoft/vcpkg#50466 @PFZheng @ehds @isaacwong96 Could you please help review this small one-line fix when you have a chance? Thank you! 🙏 cc @simaocat — this should resolve the issue you reported in #524. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
src/braft/util.cppcaused by ambiguous namespace resolutionnamespace bvar::detail, the qualified namedetail::Sample<Stat>resolves tobvar::detail::detail::Sample<Stat>which does not existSample<Stat>which correctly resolves tobvar::detail::Sample<Stat>Background
This issue was discovered when updating the brpc port to 1.16.0 in vcpkg (microsoft/vcpkg#50466). Changes to bvar's internal namespace structure in brpc >= 1.16.0 exposed this pre-existing ambiguity, causing braft to fail to compile.
Changes
Test Plan
Made with Cursor