Open gribozavr opened 11 years ago
And there's also this gem:
Z z = ...; const_cast<Z>(z);
A different pattern:
class Z { void f() const; };
...
const Z cz = ...; const_cast<Z>(cz)->f();
This seems more like a candidate for a clang-tidy check to me, since it requires some more complex checks.
@llvm/issue-subscribers-clang-tidy
Author: Dmitri Gribenko (gribozavr)
Extended Description
I've been removing quite a few const_casts in clang codebase. All of those follow the pattern: