mnbvmar created this revision.
mnbvmar added a reviewer: alexfh.
mnbvmar added subscribers: krystyna, sbarzowski, Prazek, staronj, cfe-commits.
This implements unnecessary-mutable check. It's still bug-prone and might
produce false positives, so all suggestions are welcome.
http://reviews.llvm.o
alexfh added a subscriber: alexfh.
Comment at: docs/clang-tidy/checks/misc-unnecessary-mutable.rst:9
@@ +8,3 @@
+
+.. code-block:: c++
+ class SomeClass {
Please verify the documentation can be built without errors. On Ubuntu this
boils down to:
Install sphinx:
aaron.ballman added a subscriber: aaron.ballman.
aaron.ballman added a comment.
One quick thought: we should probably have a test that includes a macro to make
sure nothing explodes. e.g.,
#define FIELD(T, N) mutable T N
class C {
FIELD(int, RemoveMutable);
FIELD(int, KeepMutable)
Prazek added a reviewer: Prazek.
Comment at: clang-tidy/misc/UnnecessaryMutableCheck.cpp:152
@@ +151,3 @@
+// it is the only declaration in a declaration chain.
+static bool CheckRemoval(SourceManager &SM, const SourceLocation &LocStart,
+ const SourceLocat
etienneb added a subscriber: etienneb.
Comment at: clang-tidy/misc/UnnecessaryMutableCheck.cpp:38
@@ +37,3 @@
+
+ void RunSearch(Decl *Declaration) {
+auto *Body = Declaration->getBody();
nit: Decl *Declaration -> const Decl *Declaration
and other visitor fu
aaron.ballman added inline comments.
Comment at: test/clang-tidy/misc-unnecessary-mutable.cpp:237
@@ +236,3 @@
+
+// Fails for now.
+/*
It would be good to put further information in about why this fails.
http://reviews.llvm.org/D20053
___
mnbvmar updated this revision to Diff 59445.
mnbvmar added a comment.
Fixes done.
Added macro test.
Docs should be working now.
Updated docs.
http://reviews.llvm.org/D20053
Files:
clang-tidy/misc/CMakeLists.txt
clang-tidy/misc/MiscTidyModule.cpp
clang-tidy/misc/UnnecessaryMutableCheck.cpp
mnbvmar marked 14 inline comments as done.
mnbvmar added a comment.
http://reviews.llvm.org/D20053
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
mnbvmar added inline comments.
Comment at: clang-tidy/misc/UnnecessaryMutableCheck.cpp:47
@@ +46,3 @@
+
+ void RunSearch(const Decl *Declaration) {
+auto *Body = Declaration->getBody();
Unless I miss something, the moment we set FoundNonConstUse to true, we s
etienneb added inline comments.
Comment at: clang-tidy/misc/UnnecessaryMutableCheck.cpp:23
@@ +22,3 @@
+
+// Matcher checking if the declaration is non-macro existent mutable which is
+// not dependent on context.
add an anonymous namespace around this declaration
Eugene.Zelenko added a subscriber: Eugene.Zelenko.
Eugene.Zelenko added a comment.
Please mention this check in docs/ReleaseNotes.rst (in alphabetical order).
http://reviews.llvm.org/D20053
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
htt
11 matches
Mail list logo