================
@@ -7425,6 +7425,12 @@ void ASTRecordWriter::writeOpenACCClause(const 
OpenACCClause *C) {
     writeEnum(DC->getDefaultClauseKind());
     return;
   }
+  case OpenACCClauseKind::If: {
+    const auto *IC = cast<OpenACCIfClause>(C);
+    writeSourceLocation(IC->getLParenLoc());
+    AddStmt(const_cast<Expr *>(IC->getConditionExpr()));
----------------
erichkeane wrote:

Removing 'const' from these handful of places means that a whole ton of other 
stuff ends up needing to lose const-correctness.  The Construct storage needs 
to stop using 'const' clauses (or at least the 'clauses' function), and 
'const'ness gets lost everywhere else. .

These pair of const-casts seemed like the 'lesser' of evils?

WDYT?  I could take the time to de-const much of the AST nodes if you'd like, 
but was hoping to avoid that (And I don't know if that means NO const casts, we 
might need some anyway).  

https://github.com/llvm/llvm-project/pull/88411
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to