[clang] Change `ASTUnit::getASTContext() const` to return a non-const `ASTContext` (PR #130096)
Shafik Yaghmour via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 6 10:46:21 PST 2025
https://github.com/shafik commented:
Just throwing in my $0.02 and saying I agree w/ Aaron and Vlad here, this is not the right direction. Having a `const` method return a non-const that we will then mutate is just not clean code.
Having to use `const_cast` documents we are violating expectations and marks this as something we need to clean up in the future.
https://github.com/llvm/llvm-project/pull/130096
More information about the cfe-commits
mailing list