File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -2990,6 +2990,8 @@ bool Compiler<Emitter>::VisitCXXReinterpretCastExpr(
29902990 if (PointeeToT && PointeeFromT) {
29912991 if (isIntegralType (*PointeeFromT) && isIntegralType (*PointeeToT))
29922992 Fatal = false ;
2993+ } else {
2994+ Fatal = SubExpr->getType ().getTypePtr () != E->getType ().getTypePtr ();
29932995 }
29942996
29952997 if (!this ->emitInvalidCast (CastKind::Reinterpret, Fatal, E))
Original file line number Diff line number Diff line change @@ -185,3 +185,11 @@ namespace InitLinkToRVO {
185185 constexpr A make () { return A {}; }
186186 static_assert (make().z == 4 , " " );
187187}
188+
189+ namespace DynamicCast {
190+ struct S { int x, y; } s;
191+ constexpr S* sptr = &s;
192+ struct Str {
193+ int b : reinterpret_cast <S*>(sptr) == reinterpret_cast <S*>(sptr);
194+ };
195+ }
You can’t perform that action at this time.
0 commit comments