Rule Definition
Casting from a derived class to a base class is implicit. If you explicitly write a cast, it will work too, but it will also work in a situation where it should not, for instance if the class hierarchy has changed.
Relying on implicit casting is therefore both simpler to use and safer.
Remediation
Following the example, if A and B were not related in any way, line 1 would still compile (and be equivalent to reinterpret_cast), but would be wrong, see rule "Never perform C-style cast between incompatible Class pointers" (id 8002).
If A and B were related, but B not be derived from A, line 1 and 2 would still compile, but would be wrong. See rule "A pointer to a base Class shall only be cast to a pointer to a derived Class by means of 'dynamic_cast'" (id 8060).
Violation Code Sample
class A
{
};
class B : public A
{
};
A* p1 = (A*)(new B()); // 1: Violation
A* p1 = static_cast<A*>(new B()); // 2: Violation
A* p1 = new B(); // 3: OK
Related Technologies
C++
Technical Criterion
Programming Practices - OO Inheritance and Polymorphism
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.