We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 980531c commit c2ae572Copy full SHA for c2ae572
clang/lib/AST/ByteCode/Compiler.cpp
@@ -2990,6 +2990,8 @@ bool Compiler<Emitter>::VisitCXXReinterpretCastExpr(
2990
if (PointeeToT && PointeeFromT) {
2991
if (isIntegralType(*PointeeFromT) && isIntegralType(*PointeeToT))
2992
Fatal = false;
2993
+ } else {
2994
+ Fatal = SubExpr->getType().getTypePtr() != E->getType().getTypePtr();
2995
}
2996
2997
if (!this->emitInvalidCast(CastKind::Reinterpret, Fatal, E))
clang/test/AST/ByteCode/cxx11.cpp
@@ -185,3 +185,11 @@ namespace InitLinkToRVO {
185
constexpr A make() { return A {}; }
186
static_assert(make().z == 4, "");
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
+}
0 commit comments