rsmith added a comment. Why does this construct justify the compiler emitting a warning? It seems to be reporting a fact about the code rather than a bug, and as there are many coding styles where variables are not routinely marked as const whenever possible, this appears to be checking that the code conforms to a particular coding style. As such, this seems like a better fit as a clang-tidy check than as a compiler warning.
The choice to only apply this check to pointer parameters to functions seems arbitrary. What is the motivation for that? ================ Comment at: include/clang/AST/Decl.h:854 @@ +853,3 @@ + /// \brief Whether this variable has non-const use so it can't be const. + unsigned NonConstUse:1; + ---------------- This is not OK; it'll make all `VarDecl`s 8 bytes larger on 64-bit systems. http://reviews.llvm.org/D12359 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits