[PATCH] D31153: Add the ability to use the children() range API in a const-correct manner

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 27 07:53:37 PDT 2017


dblaikie added a comment.

As I mentioned to Craig Topper recently on another review, generally when implementing const and non-const overloads the non-const is implemented in terms of the const overload (& const_casts away const on the result). This ensures no UB if the const overload is called on a truly const object. Even if there aren't any truly const Stmts today, I'd still prefer the code be written so as not to assume they couldn't exist.


https://reviews.llvm.org/D31153





More information about the cfe-commits mailing list