================
@@ -8533,7 +8533,9 @@ class ExprEvaluatorBase
}
bool VisitCXXReinterpretCastExpr(const CXXReinterpretCastExpr *E) {
- CCEDiag(E, diag::note_constexpr_invalid_cast)
+ bool IsPtrToInt = E->getCastKind() == CK_PointerToIntegral;
+ CCEDiag(E, IsPtrToInt ? diag::note_constexpr_invalid_cast_ptrtoint
+ : diag::note_constexpr_invalid_cast)
----------------
eleviant wrote:
I think so. It's actually checked by line 14 in microsoft-constexpr2.cpp:
```
constexpr long b2 = FIELD_OFFSET2(S, y);
```
where FIELD_OFFSET2 is
```
#define FIELD_OFFSET2(type, field) (reinterpret_cast<LONG_PTR>(&(((type
*)0)->field)))
```
https://github.com/llvm/llvm-project/pull/197005
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits