[PATCH] D15332: new clang-tidy checker readability-non-const-parameter
Daniel Marjamäki via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 15 01:23:34 PDT 2016
danielmarjamaki added inline comments.
================
Comment at: clang-tidy/readability/NonConstParameterCheck.cpp:95-98
@@ +94,6 @@
+ const QualType T = VD->getType();
+ if (T->isPointerType() && !T->getPointeeType().isConstQualified())
+ markCanNotBeConst(VD->getInit(), true);
+ else if (T->isArrayType())
+ markCanNotBeConst(VD->getInit(), true);
+ }
----------------
Prazek wrote:
> This looks like it could be in the same if.
Yes it could. But would it make the code more or less readable? It wouldn't be a 1-line condition anymore then.
https://reviews.llvm.org/D15332
More information about the cfe-commits
mailing list