================
@@ -8503,8 +8503,12 @@ ExprResult InitializationSequence::Perform(Sema &S,
Expr::EvalResult ER;
if (Entity.getType()->getAs<PointerType>() &&
CurInit.get()->EvaluateAsRValue(ER, S.Context) &&
- !ER.Val.isNullPointer()) {
+ // We continue and let it error later if Rvalue is not a pointer
+ ER.Val.isLValue() &&
+ !ER.Val.isNullPointer() &&
+ !ER.Val.getLValueBase().isNull()) {
----------------
Fznamznon wrote:
Why do we need both checks? i.e. `ER.Val.isNullPointer()` AND
`ER.Val.getLValueBase().isNull()`
https://github.com/llvm/llvm-project/pull/180376
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits