================ @@ -13367,6 +13367,21 @@ static void DiagnoseConstAssignment(Sema &S, const Expr *E, if (!DiagnosticEmitted) { S.Diag(Loc, diag::err_typecheck_assign_const) << ExprRange << ConstVariable << VD << VD->getType(); + ExprResult Deref; + Expr *TE = const_cast<Expr *>(E); ---------------- Sirraide wrote:
If it’s easier to use `const_cast` here than to change the parameter to be non-`const`, then that’s fine imo. Our const-correctness w/ AST nodes is all over the place anyway, so while not ‘ideal’, it’s not the end of the world imo https://github.com/llvm/llvm-project/pull/94159 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits