#include "envoy/api/v2/route/route_components.pb.h" #include "envoy/config/cluster/v4alpha/cluster.pb.h" #include "envoy/config/overload/v2alpha/overload.pb.h" #include "envoy/config/overload/v3/overload.pb.h" #define API_NO_BOOST(x) x #define BAR(x) x #define ASSERT(x) static_cast(x) using envoy::config::overload::v3::Trigger; using envoy::config::cluster::v4alpha::Cluster; using MutableStringClusterAccessor = std::string* (Cluster::*)(); class ThresholdTriggerImpl { public: ThresholdTriggerImpl(const envoy::config::overload::v3::Trigger& config) { switch (config.trigger_oneof_case()) { case envoy::config::overload::v3::Trigger::TriggerOneofCase::kThreshold: break; default: break; } switch (config.trigger_oneof_case()) { case Trigger::kThreshold: break; default: break; } API_NO_BOOST(envoy::api::v2::route::RouteAction) route_action; route_action.host_rewrite(); API_NO_BOOST(envoy::config::overload::v2alpha::Trigger) foo; BAR(API_NO_BOOST(envoy::config::overload::v2alpha::Trigger)) bar; BAR(envoy::config::overload::v3::Trigger) baz; envoy::config::overload::v3::ThresholdTrigger::default_instance(); ASSERT(envoy::config::overload::v3::Trigger::TriggerOneofCase::kThreshold == Trigger::kThreshold); ASSERT(Foo::kThreshold == Trigger::kThreshold); envoy::config::cluster::v4alpha::Cluster::LbPolicy_Name(0); static_cast(envoy::config::cluster::v4alpha::Cluster::MAGLEV); MutableStringClusterAccessor foo2 = &envoy::config::cluster::v4alpha::Cluster::mutable_name; static_cast(foo2); } using Foo = envoy::config::overload::v3::Trigger; };