interop: a registry spelled on an `any` virtual parameter is never validated against the method's
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Start with detail::validate_method_parameter and param_registry in core.hpp, then compare the interop specializations in interop/std_any.hpp, interop/boost_any.hpp, and interop/boost_type_erasure.hpp. Run the compile_fail_registrymismatch* tests and test_dispatch_std_any.cpp. Done means interop parameters reject registry mismatches while retaining their documented registry-selection behavior.
索引モデルが issue の本文から書いたものです。
説明
(Written by Claude Code, on behalf of @jll63.)
detail::validate_method_parameter for the any and Boost.TypeErasure interop headers takes a
ParamRegistry and never compares it with the method's registry. A mismatch that every other
virtual parameter shape rejects is accepted silently — and the parameter is not inert, because it
decides the registry of a method that does not name one.
Behaviour
Parameter spells R, method is on other_registry:
| parameter | decides an unannotated method's registry | checked against a method naming another |
|---|---|---|
virtual_<Animal&, R> — ordinary carrier |
yes | yes — core.hpp:2330, "registry mismatch: the parameter belongs to another registry" |
virtual_<const std::any&, R> — interop |
yes | no — accepted silently |
virtual_any<A, R>& |
no, abstains | yes — virtual_any.hpp:552, "registry mismatch" |
Reproducer
#include <any>
#include <boost/openmethod.hpp>
#include <boost/openmethod/interop/std_any.hpp>
using namespace boost::openmethod;
struct other_registry : default_registry::with<> {};
// Passes: the mismatch is accepted.
static_assert(detail::validate_method_parameter<
virtual_<const std::any&, default_registry>, other_registry, void>::value);
// Also passes: the spelled registry decided the method's registry.
static_assert(std::is_same_v<
detail::method_registry<void(virtual_<const std::any&, other_registry>)>,
other_registry>);
Both compile on GCC 13 at -std=c++17. Replacing the first parameter with a plain
virtual_<Animal&, default_registry> hard-errors at core.hpp:2330 instead.
Cause
The specializations are unconditional : std::true_type {}, with ParamRegistry deduced and then
unused:
interop/std_any.hpp:24,29,33interop/boost_any.hpp:24,29,33interop/boost_type_erasure.hpp:98,103,108,113,118,123
Meanwhile param_registry's generic virtual_<T, Registry> pattern (core.hpp:2392) picks the
registry up — no interop header specializes param_registry — so the parameter votes in
agreed_registry and method_registry_aux takes it.
virtual_any is unaffected: its specializations match virtual_any<Any, Registry>&, a different
shape, and do compare.
Consequence
BOOST_OPENMETHOD(f, (virtual_<const std::any&, other_registry>), void);
with no registry named on the method builds f in other_registry. Overriders registered against
the default registry land in a different dispatch table, and the call reports no_overrider at run
time after initialize().
Coverage
None of the five compile_fail_*registry*mismatch* tests uses an interop shape; #116 added only
positive static_asserts (test_dispatch_std_any.cpp).
- 主要言語
- C++
- スター
- 13
- フォーク
- 6
- 平均マージ
- 1日 4分
- マージ済み PR(30日)
- 20
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
boostorg/openmethod のほかの issue
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
boostorg/openmethod#70 ·
メンテナーはふだん 1 日以内に返信
-
support member functions as overriders再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープンenhancement explore
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
boostorg/openmethod#53 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
boostorg/openmethod#11 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
boostorg/openmethod#9 ·
メンテナーはふだん 1 日以内に返信
boostorg/openmethod の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
ros-navigation/navigation2#6648 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
[BUG] OTA Requestor accepts reserved provider endpoint 0xFFFF対応中かも @Chapoly1305 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
project-chip/connectedhomeip#74742 ·
メンテナーはふだん 1 日以内に返信