dblaikie added inline comments.
================ Comment at: include/clang/AST/Expr.h:4025 child_range children() { + const_child_range CCR = const_cast<const InitListExpr *>(this)->children(); + return child_range(cast_away_const(CCR.begin()), ---------------- If this is adding const, can you use a weaker cast? (I guess what would be ideal here would be implicit_cast - if you're interested you could add that - otherwise... yeah, I guess static_cast could do other nasty things, etc, so there's nothing good) ================ Comment at: include/clang/AST/StmtIterator.h:148-150 +inline StmtIterator cast_away_const(const ConstStmtIterator &RHS) { + return RHS; +} ---------------- Maybe I'm missing something - what stops code from doing this conversion implicitly/accidentally all over the place? (I would've expecetd cast_away_const to be a friend or something, to only allow the conversion through this explicit call/operation) https://reviews.llvm.org/D31153 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits