benlangmuir wrote:

> There are places in Clang where we store the result of the const function in 
> some kind of long-lived data structure, and someplace else modify the result 
> of the non-const function, expecting the change to be reflected.

I would be comfortable with this, because you would still have to call a 
distinctly named function (getMut...) in order to do the mutation itself IIUC.  
If they are const-casting of course that wouldn't be enough.

> Note that you can use CompilerInvocationBase to get the behavior you're 
> describing.

I think `CompilerInvocationBase` goes a step farther than what I described, 
because it would give you the mutating methods with the original names, no?

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

Reply via email to