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(
2990
2990
if (PointeeToT && PointeeFromT) {
2991
2991
if (isIntegralType (*PointeeFromT) && isIntegralType (*PointeeToT))
2992
2992
Fatal = false ;
2993
+ } else {
2994
+ Fatal = SubExpr->getType ().getTypePtr () != E->getType ().getTypePtr ();
2993
2995
}
2994
2996
2995
2997
if (!this ->emitInvalidCast (CastKind::Reinterpret, Fatal, E))
Original file line number Diff line number Diff line change @@ -185,3 +185,11 @@ namespace InitLinkToRVO {
185
185
constexpr A make () { return A {}; }
186
186
static_assert (make().z == 4 , " " );
187
187
}
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