== Compliant Solution

----
  class A { public: virtual ~A(){} };
  class B : public A { public: void doSomething(){} };

  void func(A *a, float f) {
    if (B* b = dynamic_cast<B*>(a)) {
      b->doSomething();
    }
    int x = std::bit_cast<int>(f);
  }
----
