I give up on this...
$5.2.7/2- "If T is a pointer type, v shall be an rvalue of a pointer to complete class type, and the result is an rvalue of type T. If T is a reference type, v shall be an lvalue of a complete class type, and the result is an lvalue of the type referred to by T."
In accordance with the above, the following code should be well-formed.
struct A{};
struct B : A{};
int main(){
B b;
A a, &ar1 = b;
B& rb1 = dynamic_cast<B&>(ar1); // Does not $5.2.7/2 apply here?
B& rb2 = dynamic_cast<B&>(a); // and also here?
}
But it is not. All compilers complain about the operand to dynamic_cast not being polymorphic in accordance with
$5.2.7/6- Otherwise, v shall be a pointer to or an lvalue of a polymorphic type (10.3).
So my question is what does $5.2.7/2 mean? Why does $5.2.7/6 kick in here?